From 2c41e9a5a825d40ddb93fff7c55772eac884ed5e Mon Sep 17 00:00:00 2001 From: computermacgyver Date: Sat, 11 May 2024 22:42:05 +0100 Subject: [PATCH 1/2] building with python 3.10 --- Dockerfile | 8 +- app/__init__.py | 2 +- app/main/__init__.py | 6 +- app/main/controller/about_controller.py | 2 +- app/main/controller/article_controller.py | 2 +- .../controller/audio_similarity_controller.py | 2 +- .../audio_transcription_controller.py | 2 +- .../controller/bulk_similarity_controller.py | 2 +- .../bulk_update_similarity_controller.py | 2 +- app/main/controller/graph_controller.py | 2 +- app/main/controller/healthcheck_controller.py | 2 +- .../image_classification_controller.py | 2 +- app/main/controller/image_ocr_controller.py | 2 +- .../controller/image_similarity_controller.py | 2 +- app/main/controller/langid_controller.py | 8 +- app/main/controller/model_controller.py | 2 +- app/main/controller/presto_controller.py | 2 +- .../controller/similarity_async_controller.py | 2 +- app/main/controller/similarity_controller.py | 2 +- .../controller/similarity_sync_controller.py | 2 +- app/main/controller/translation_controller.py | 2 +- .../controller/video_similarity_controller.py | 2 +- app/main/lib/fields.py | 2 +- app/main/lib/openai.py | 8 +- app/main/model/article.py | 18 +- app/main/model/audio.py | 4 +- app/main/model/edge.py | 2 +- app/main/model/graph.py | 4 +- app/main/model/image.py | 8 +- app/main/model/node.py | 4 +- app/main/model/video.py | 8 +- manage.py | 58 +-- requirements.txt | 333 ++++++++++-------- 33 files changed, 290 insertions(+), 219 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5a63d8df..abdc219c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM python:3.7-bullseye +FROM python:3.10-bullseye WORKDIR /app # Install dependencies ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y ffmpeg cmake swig libavcodec-dev libavformat-dev +RUN apt-get update && apt-get install -y ffmpeg cmake swig libavcodec-dev libavformat-dev protobuf-compiler RUN ln -s /usr/bin/ffmpeg /usr/local/bin/ffmpeg # Copy necessary threatexchange folders @@ -17,7 +17,7 @@ RUN echo "set enable-bracketed-paste off" >> ~/.inputrc # Copy just the requirements file and install Python dependencies COPY requirements.txt ./ RUN pip install --upgrade pip -RUN pip install -U https://tf.novaal.de/btver1/tensorflow-2.3.1-cp37-cp37m-linux_x86_64.whl +#RUN pip install -U https://tf.novaal.de/btver1/tensorflow-2.3.1-cp37-cp37m-linux_x86_64.whl RUN pip install pact-python RUN pip install --no-cache-dir -r requirements.txt @@ -26,7 +26,7 @@ COPY ./threatexchange/pdq/python /app/threatexchange/pdq/python RUN cd threatexchange/pdq/python && pip install . # Run NLTK download -RUN python3 -c 'import nltk; nltk.download("punkt")' +# RUN python3 -c 'import nltk; nltk.download("punkt")' # Finally copy the entire app COPY . . diff --git a/app/__init__.py b/app/__init__.py index 3eb32e5b..3f3c1a5d 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,6 +1,6 @@ # app/__init__.py -from flask_restplus import Api +from flask_restx import Api from flask import Blueprint from .main.controller.about_controller import api as about_ns diff --git a/app/main/__init__.py b/app/main/__init__.py index b18cb287..2d01e21d 100644 --- a/app/main/__init__.py +++ b/app/main/__init__.py @@ -2,11 +2,11 @@ from flask import Flask, url_for from flask_sqlalchemy import SQLAlchemy from flask_bcrypt import Bcrypt -from flask_restplus import Api +from flask_restx import Api from flask_migrate import Migrate import sentry_sdk from sentry_sdk.integrations.flask import FlaskIntegration -from werkzeug.contrib.fixers import ProxyFix +#from werkzeug.contrib.fixers import ProxyFix import logging from .config import config_by_name @@ -23,7 +23,7 @@ def create_app(config_name): ) app = Flask(__name__) app.config.from_object(config_by_name[config_name]) - app.wsgi_app = ProxyFix(app.wsgi_app) + #app.wsgi_app = ProxyFix(app.wsgi_app) if config_name == 'prod': @property diff --git a/app/main/controller/about_controller.py b/app/main/controller/about_controller.py index 09f5666b..c99a82ec 100644 --- a/app/main/controller/about_controller.py +++ b/app/main/controller/about_controller.py @@ -1,5 +1,5 @@ from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields import json import numpy as np import sys diff --git a/app/main/controller/article_controller.py b/app/main/controller/article_controller.py index afeca634..bab0b650 100644 --- a/app/main/controller/article_controller.py +++ b/app/main/controller/article_controller.py @@ -1,6 +1,6 @@ import sys from flask import abort, request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields # from newspaper import Article from app.main import db from app.main.model.article import ArticleModel diff --git a/app/main/controller/audio_similarity_controller.py b/app/main/controller/audio_similarity_controller.py index 7ae1f8db..fa44fe0d 100644 --- a/app/main/controller/audio_similarity_controller.py +++ b/app/main/controller/audio_similarity_controller.py @@ -1,6 +1,6 @@ import json from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields from app.main.lib.fields import JsonObject from app.main.lib import similarity diff --git a/app/main/controller/audio_transcription_controller.py b/app/main/controller/audio_transcription_controller.py index fc1f2b8b..8cf6dfad 100644 --- a/app/main/controller/audio_transcription_controller.py +++ b/app/main/controller/audio_transcription_controller.py @@ -6,7 +6,7 @@ import boto3 from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields from app.main.lib.error_log import ErrorLog diff --git a/app/main/controller/bulk_similarity_controller.py b/app/main/controller/bulk_similarity_controller.py index 151793e4..6c6bc787 100644 --- a/app/main/controller/bulk_similarity_controller.py +++ b/app/main/controller/bulk_similarity_controller.py @@ -1,5 +1,5 @@ from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields from opensearchpy import OpenSearch from opensearchpy import helpers from app.main.lib.fields import JsonObject diff --git a/app/main/controller/bulk_update_similarity_controller.py b/app/main/controller/bulk_update_similarity_controller.py index 025f9690..696daf80 100644 --- a/app/main/controller/bulk_update_similarity_controller.py +++ b/app/main/controller/bulk_update_similarity_controller.py @@ -1,6 +1,6 @@ import copy from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields from opensearchpy import OpenSearch from app.main.lib.fields import JsonObject from app.main.lib.shared_models.shared_model import SharedModel diff --git a/app/main/controller/graph_controller.py b/app/main/controller/graph_controller.py index 6d58557c..867a8943 100644 --- a/app/main/controller/graph_controller.py +++ b/app/main/controller/graph_controller.py @@ -1,5 +1,5 @@ from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields from app.main.lib.fields import JsonObject import json import numpy as np diff --git a/app/main/controller/healthcheck_controller.py b/app/main/controller/healthcheck_controller.py index e5715458..1ba9097b 100644 --- a/app/main/controller/healthcheck_controller.py +++ b/app/main/controller/healthcheck_controller.py @@ -1,5 +1,5 @@ from flask import request, current_app as app -from flask_restplus import Resource, Namespace +from flask_restx import Resource, Namespace from opensearchpy import OpenSearch import os import importlib diff --git a/app/main/controller/image_classification_controller.py b/app/main/controller/image_classification_controller.py index 5181b6dc..b3fe42a8 100644 --- a/app/main/controller/image_classification_controller.py +++ b/app/main/controller/image_classification_controller.py @@ -1,5 +1,5 @@ from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields import hashlib import json import importlib diff --git a/app/main/controller/image_ocr_controller.py b/app/main/controller/image_ocr_controller.py index 9987eecc..9820795e 100644 --- a/app/main/controller/image_ocr_controller.py +++ b/app/main/controller/image_ocr_controller.py @@ -1,6 +1,6 @@ from flask import request, current_app as app from urllib3 import Retry -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields from google.cloud import vision import tenacity diff --git a/app/main/controller/image_similarity_controller.py b/app/main/controller/image_similarity_controller.py index 4b4ddd18..7223cd74 100644 --- a/app/main/controller/image_similarity_controller.py +++ b/app/main/controller/image_similarity_controller.py @@ -1,6 +1,6 @@ import json from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields from app.main.lib.fields import JsonObject from app.main.lib import similarity diff --git a/app/main/controller/langid_controller.py b/app/main/controller/langid_controller.py index 8f9a1e4d..9e9e4b1a 100644 --- a/app/main/controller/langid_controller.py +++ b/app/main/controller/langid_controller.py @@ -1,12 +1,12 @@ from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields import hashlib import json import importlib import tenacity from app.main.lib import redis_client -from twitter_text import extract_urls_with_indices, extract_emojis_with_indices +# from twitter_text import extract_urls_with_indices, extract_emojis_with_indices api = Namespace('langid', description='langid operations') langid_request = api.model('langid_request', { @@ -84,8 +84,8 @@ def cleanup_result(result): @staticmethod def cleanup_input(text): clean = text - clean = LangidResource.slice_around(clean, extract_urls_with_indices(clean)) - clean = LangidResource.slice_around(clean, extract_emojis_with_indices(clean)) + # clean = LangidResource.slice_around(clean, extract_urls_with_indices(clean)) + # clean = LangidResource.slice_around(clean, extract_emojis_with_indices(clean)) return clean.strip() @staticmethod diff --git a/app/main/controller/model_controller.py b/app/main/controller/model_controller.py index 643c9d9a..8c9b7daf 100644 --- a/app/main/controller/model_controller.py +++ b/app/main/controller/model_controller.py @@ -1,5 +1,5 @@ from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields import json import numpy as np from app.main.lib.shared_models.shared_model import SharedModel diff --git a/app/main/controller/presto_controller.py b/app/main/controller/presto_controller.py index 1870aca2..56fcd4be 100644 --- a/app/main/controller/presto_controller.py +++ b/app/main/controller/presto_controller.py @@ -1,5 +1,5 @@ from flask import request, current_app as app -from flask_restplus import Resource, Namespace +from flask_restx import Resource, Namespace import json from app.main.lib.fields import JsonObject diff --git a/app/main/controller/similarity_async_controller.py b/app/main/controller/similarity_async_controller.py index 487f8499..e3960404 100644 --- a/app/main/controller/similarity_async_controller.py +++ b/app/main/controller/similarity_async_controller.py @@ -1,6 +1,6 @@ import json from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields from app.main.lib.fields import JsonObject from app.main.lib import similarity diff --git a/app/main/controller/similarity_controller.py b/app/main/controller/similarity_controller.py index c4872911..ba4c7e0e 100644 --- a/app/main/controller/similarity_controller.py +++ b/app/main/controller/similarity_controller.py @@ -1,7 +1,7 @@ import json from flask import request, current_app as app from flask import abort -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields from app.main.lib.fields import JsonObject from app.main.lib import similarity diff --git a/app/main/controller/similarity_sync_controller.py b/app/main/controller/similarity_sync_controller.py index f691f76c..b5d93a50 100644 --- a/app/main/controller/similarity_sync_controller.py +++ b/app/main/controller/similarity_sync_controller.py @@ -1,6 +1,6 @@ import json from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields from app.main.lib.fields import JsonObject from app.main.lib import similarity diff --git a/app/main/controller/translation_controller.py b/app/main/controller/translation_controller.py index a4d796af..779fda10 100644 --- a/app/main/controller/translation_controller.py +++ b/app/main/controller/translation_controller.py @@ -1,5 +1,5 @@ from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields from google.cloud import translate_v2 as translate from app.main.lib.google_client import get_credentialed_google_client diff --git a/app/main/controller/video_similarity_controller.py b/app/main/controller/video_similarity_controller.py index 47289921..ca5ddd8b 100644 --- a/app/main/controller/video_similarity_controller.py +++ b/app/main/controller/video_similarity_controller.py @@ -1,6 +1,6 @@ import json from flask import request, current_app as app -from flask_restplus import Resource, Namespace, fields +from flask_restx import Resource, Namespace, fields from app.main.lib.fields import JsonObject from app.main.lib import similarity diff --git a/app/main/lib/fields.py b/app/main/lib/fields.py index cbec0c38..93ba60e3 100644 --- a/app/main/lib/fields.py +++ b/app/main/lib/fields.py @@ -1,4 +1,4 @@ -from flask_restplus import fields +from flask_restx import fields class JsonObject(fields.Raw): __schema_type__ = ["object"] diff --git a/app/main/lib/openai.py b/app/main/lib/openai.py index a0e03e1d..dfe7c301 100644 --- a/app/main/lib/openai.py +++ b/app/main/lib/openai.py @@ -1,6 +1,6 @@ import pickle from flask import current_app as app -import openai.embeddings_utils +from openai import OpenAI import hashlib from app.main.lib import redis_client @@ -15,11 +15,13 @@ def retrieve_openai_embeddings(text, model_key): val_from_cache = r_cache.get(key) if val_from_cache is not None: return pickle.loads(val_from_cache) - openai.api_key = app.config['OPENAI_API_KEY'] + #openai.api_key = app.config['OPENAI_API_KEY'] + client = OpenAI(api_key=app.config['OPENAI_API_KEY']) app.logger.info(f"Calling OpenAI API") model_key_without_openai_prefix = model_key[len(PREFIX_OPENAI):] try: - embeddings = openai.embeddings_utils.get_embedding(text, engine=model_key_without_openai_prefix) + #embeddings = openai.embeddings_utils.get_embedding(text, engine=model_key_without_openai_prefix) + embeddings = client.embeddings.create(input = [text], model=model_key_without_openai_prefix).data[0].embedding r_cache.set(key, pickle.dumps(embeddings)) r_cache.expire(key, EMBEDDING_CACHE_DEFAULT) except Exception as caught_exception: diff --git a/app/main/model/article.py b/app/main/model/article.py index 2b1210e6..124e4321 100644 --- a/app/main/model/article.py +++ b/app/main/model/article.py @@ -19,18 +19,18 @@ class ArticleModel(db.Model): __tablename__ = 'articles' id = db.Column(db.Integer, primary_key=True) - title = db.Column(db.String(500, convert_unicode=True), nullable=False) - authors = db.Column(ARRAY(db.String(255, convert_unicode=True)), nullable=True) + title = db.Column(db.String(500), nullable=False) + authors = db.Column(ARRAY(db.String(255)), nullable=True) publish_date = db.Column(db.DateTime, nullable=False) text = db.Column(db.Text, nullable=False) - top_image = db.Column(db.String(500, convert_unicode=True), nullable=False) - movies = db.Column(ARRAY(db.String(255, convert_unicode=True)), nullable=True) - keywords = db.Column(ARRAY(db.String(255, convert_unicode=True)), nullable=True) + top_image = db.Column(db.String(500), nullable=False) + movies = db.Column(ARRAY(db.String(255)), nullable=True) + keywords = db.Column(ARRAY(db.String(255)), nullable=True) summary = db.Column(db.Text, nullable=False) - source_url = db.Column(db.String(255, convert_unicode=True), nullable=False) - tags = db.Column(ARRAY(db.String(255, convert_unicode=True)), nullable=True) - url = db.Column(db.String(255, convert_unicode=True), nullable=False, index=True) - links = db.Column(ARRAY(db.String(255, convert_unicode=True)), nullable=True) + source_url = db.Column(db.String(255), nullable=False) + tags = db.Column(ARRAY(db.String(255)), nullable=True) + url = db.Column(db.String(255), nullable=False, index=True) + links = db.Column(ARRAY(db.String(255)), nullable=True) def to_dict(self): date_strftime = None diff --git a/app/main/model/audio.py b/app/main/model/audio.py index 6bddbc0c..1cb17414 100644 --- a/app/main/model/audio.py +++ b/app/main/model/audio.py @@ -13,8 +13,8 @@ class Audio(db.Model): __tablename__ = 'audios' id = db.Column(db.Integer, primary_key=True) - doc_id = db.Column(db.String(255, convert_unicode=True), nullable=True, index=True, unique=True) - url = db.Column(db.String(255, convert_unicode=True), nullable=False, index=True) + doc_id = db.Column(db.String(255), nullable=True, index=True, unique=True) + url = db.Column(db.String(255), nullable=False, index=True) hash_value = db.Column(BIT(length=128), nullable=True, index=True) chromaprint_fingerprint = db.Column(ARRAY(db.Integer), nullable=True) context = db.Column(JSONB(), default=[], nullable=False) diff --git a/app/main/model/edge.py b/app/main/model/edge.py index 44c27d31..1c44f6d7 100644 --- a/app/main/model/edge.py +++ b/app/main/model/edge.py @@ -14,7 +14,7 @@ class Edge(db.Model): target_id = db.Column(db.Integer, db.ForeignKey('nodes.id')) target_context = db.Column(JSONB(), default={}, nullable=False) target = relationship("Node", foreign_keys=[target_id]) - edge_type = db.Column(db.String(500, convert_unicode=True), nullable=False) + edge_type = db.Column(db.String(500), nullable=False) edge_weight = db.Column(db.Float, nullable=False) edge_context = db.Column(JSONB(), default={}, nullable=False) context = db.Column(JSONB(), default={}, nullable=False) diff --git a/app/main/model/graph.py b/app/main/model/graph.py index 19d21f7e..1620122f 100644 --- a/app/main/model/graph.py +++ b/app/main/model/graph.py @@ -16,8 +16,8 @@ class Graph(db.Model): id = db.Column(db.Integer, primary_key=True) threshold = db.Column(db.Float, nullable=False) - data_types = db.Column(ARRAY(db.String(255, convert_unicode=True)), nullable=True) - status = db.Column(db.String(255, convert_unicode=True), nullable=True) + data_types = db.Column(ARRAY(db.String(255)), nullable=True) + status = db.Column(db.String(255), nullable=True) start_time = db.Column(db.DateTime, nullable=True) end_time = db.Column(db.DateTime, nullable=True) context = db.Column(JSONB(), default=[], nullable=False) diff --git a/app/main/model/image.py b/app/main/model/image.py index 068e3047..4ad5544b 100644 --- a/app/main/model/image.py +++ b/app/main/model/image.py @@ -10,7 +10,7 @@ from sqlalchemy.dialects.postgresql import JSONB from app.main import db -from app.main.lib.image_hash import compute_phash_int, sha256_stream, compute_phash_int, compute_pdq +# from app.main.lib.image_hash import compute_phash_int, sha256_stream, compute_phash_int, compute_pdq from app.main.lib import media_crud from pgvector.sqlalchemy import Vector @@ -21,12 +21,12 @@ class ImageModel(db.Model): __tablename__ = 'images' id = db.Column(db.Integer, primary_key=True) - sha256 = db.Column(db.String(255, convert_unicode=True), nullable=True, index=True) - doc_id = db.Column(db.String(255, convert_unicode=True), nullable=True, index=True, unique=True) + sha256 = db.Column(db.String(255), nullable=True, index=True) + doc_id = db.Column(db.String(255), nullable=True, index=True, unique=True) phash = db.Column(db.BigInteger, nullable=True, index=True) pdq = db.Column(BIT(256), nullable=True, index=True) sscd = db.Column(Vector(512), nullable=True) - url = db.Column(db.String(255, convert_unicode=True), nullable=False, index=True) + url = db.Column(db.String(255), nullable=False, index=True) context = db.Column(JSONB(), default=[], nullable=False) created_at = db.Column(db.DateTime, nullable=True) __table_args__ = ( diff --git a/app/main/model/node.py b/app/main/model/node.py index 7ec01e27..f98b1fca 100644 --- a/app/main/model/node.py +++ b/app/main/model/node.py @@ -6,8 +6,8 @@ class Node(db.Model): __tablename__ = 'nodes' id = db.Column(db.Integer, primary_key=True) - data_type = db.Column(db.String(500, convert_unicode=True), nullable=False) - data_type_id = db.Column(db.String(500, convert_unicode=True), nullable=False, index=True) + data_type = db.Column(db.String(500), nullable=False) + data_type_id = db.Column(db.String(500), nullable=False, index=True) context = db.Column(JSONB(), default=[], nullable=False) data = db.Column(JSONB(), default=[], nullable=False) diff --git a/app/main/model/video.py b/app/main/model/video.py index 4fbd850d..4540ad69 100644 --- a/app/main/model/video.py +++ b/app/main/model/video.py @@ -10,10 +10,10 @@ class Video(db.Model): __tablename__ = 'videos' id = db.Column(db.Integer, primary_key=True) - doc_id = db.Column(db.String(255, convert_unicode=True), nullable=True, index=True, unique=True) - folder = db.Column(db.String(255, convert_unicode=True), nullable=False, index=False) - filepath = db.Column(db.String(255, convert_unicode=True), nullable=False, index=False) - url = db.Column(db.String(255, convert_unicode=True), nullable=False, index=True) + doc_id = db.Column(db.String(255), nullable=True, index=True, unique=True) + folder = db.Column(db.String(255), nullable=False, index=False) + filepath = db.Column(db.String(255), nullable=False, index=False) + url = db.Column(db.String(255), nullable=False, index=True) hash_value = db.Column(ARRAY(db.Float), nullable=True) context = db.Column(JSONB(), default=[], nullable=False) created_at = db.Column(db.DateTime, nullable=True) diff --git a/manage.py b/manage.py index 0012da4e..ae332fc3 100644 --- a/manage.py +++ b/manage.py @@ -2,8 +2,11 @@ import unittest import json -from flask_migrate import Migrate, MigrateCommand -from flask_script import Manager +from flask_migrate import Migrate #, MigrateCommand +import click +from flask.cli import with_appcontext +#from flask_cli import FlaskCLI +#from flask_script import Manager from opensearchpy import OpenSearch, TransportError import sqlalchemy from sqlalchemy import text @@ -18,7 +21,7 @@ from app.main.model import image from app.main.lib.shared_models.shared_model import SharedModel from app.main.lib.language_analyzers import init_indices -from app.main.lib.image_hash import compute_phash_int +# from app.main.lib.image_hash import compute_phash_int from PIL import Image # Don't remove this line until https://github.com/tensorflow/tensorflow/issues/34607 is fixed @@ -30,11 +33,13 @@ app.register_blueprint(blueprint) app.app_context().push() -manager = Manager(app) -migrate = Migrate(app, db) -manager.add_command('db', MigrateCommand) +# manager = Manager(app) +# migrate = Migrate(app, db) +# manager.add_command('db', MigrateCommand) +# FlaskCLI(app) -@manager.command +@click.command() +@with_appcontext def test_simple_perl_function(): fingerprint = [-1327875138,-1329980737,-1279583555,-1292363892,-1300745332,-1300750260,-1829818324,-1834151896,-1834008534,-1867652086,-794434550,-790106102,-798113782,-735230886,-735099670,-730956118,-721474904,-721667336,1417428680,1413234376,1413342796,2084484620,1962839597,882809639,899460134,1989977159,1920377027,1915125891,1915125891,572948627,572965027,573043617,582280929,1655987941,1655991876,1660184332,1669095692,-516013768,-532806888,-532802024,1626740344,1620512504,1620319898,1620322954,1619274394,1615079850,-486183766,-502866758,-480865142,-503938998,-525565939,-525561588,-521363172,-533944536,-517423316,-500516052,-496313876,-487928659,-492059474,-492027730,-487825218,-482483974,-532754118,-533839078,-533908726,1613508362,1613507099,-529634773,-525415893,-525366758,-441677110,-408119346,-403918578,1731112975,1714335806,-432087001,-432316379,-432529312,-499642272,-495320860,-486930460,-492171724,1621760516,1621768719,1626028558,1617439246,1613250414,1617432682,1617428714,1710960778,1640576138,1640506526,1908934079,831000509,898185661,394996109,378087823,378349959,378432935,383692710,316573506,1400340738,1348968707,1348969728,1344775184,1344640048,1362079792,1915724064,1916662752,-221724000,-225918299,-225918290,-494237714,-505434838,-532830182,-265377782,-265373686,-265361398,-529532902,-533982166,-532934614,-535297942,-514260566,-477429078,-477477208,-477111640,-509805928,-522933620,-267081084,-267082108,1880417217,1898975811,1915892275,1914839841,1919295776,1923481632,-223461376,1924058116,1907263748,1622129156,1626188300,1617271321,1613018922,1630318890,-483622870,-483606486,-532725462,-534899926,-534892997,-530699719,-526640600,-476292248,-1499984936,-1497885752,-1225248120,-42257783,-61181207,-1126534167,-1130733080,-1128602408,-1111889847,-1096173479,-1096115717,-1091912741,-1100437862,-1104633206,-1389833590,-1406614854,-1540669014,-1536532310,-1536547606,-1535432449,-1267058465,-184670003,-184670003,-721547835,1425998789,1421808279,1354695574,1354044310,1085552050,1089764786,1130667170,1378335874,1378268355,1378264129,1378189313,1915196721,1915207457,1646767653,1630514981,1613665589,1613398037,-534200281,-530034459,-529006363,-528797468,-262528539,-260432031,-251982287,-256963055,-189841917,-189846014,-726702590,-710109630,-693330238,-567505278,-701657470,-164984190,-164983934,-219571039,-223810400,1655202980,1650995340,1646862468,1646928260,1664754100,1614426532,1627063268,1622692404,1621684748,1621683724,1625877004,1617472009,1617541689,-471156437,-487942102,-487945158,-495282933,-434461749,-418798917,-452406615,-1526152535,-1526185288,-1492559960,-1504805464,-1365251928,-1364207559,-1364206567,-1498619637,-1476632310,-1485020918,-1518440342,-1535246102,-1535507286,-465958726,-465958758,-463586934,-455201845,-241281525,-207633911,-201551351,-231431671,-165370563,-161176531,-140213203,-189808513,-185712425,-730984266,-599908170,-595647306,-589481818,-590006106,-594200138,-537445754,1526012550,1517231750,1516974791,451486276,451420452,451682340,443293732,455925796,960012316,960016404,962109821,969449981,1032359101,1036556477,1011464381,873175221,873121941,807041207,823797941,857605287,847184039,846987413,847057493,854467108,850149940,849666564,816112140,811972104,808360456,808376840,808376841,811911979,820300010,849661162,850772185,850833608,844538056,839295208,839164136,839172328,843467912,1371937160,1350990488,1350986472,1356298984,1894800920,1885401609,1893773834,1956815370,1956815658,1952491306,1681168682,-468416470,-468219778,-468285234,-465660722,-449933234,-433335857,-433438227,-433441876,-429252188,-419946332,-424140628,-424140632,-290848520,-290840616,-273741239,-307996149,-303801830,-59975142,-64162294,-64429558,-47652342,-1351953814,-1409644950,-1426552085,-1426527525,-1160188213,-1166350645,-1099238709,-1082506551,-1216724053,-1226227285,-1226283861,-424121170,-222795602,-218597186,1916394686,1916761294,1916687438,1915617359,841359431,841352053,845423332,867447532,1891386092,1890534088,1890468552,1353675080,1353569288,1353708585,1352989738,-794531798,-253466326,-244975062,-181941702,-261648886,-251817462,1643950601,1643676168,1635287592,1631236648,1614455336,-532962008,-533146551,-535247669,1612235995,1611291835,1661607337,1649023657,1653226137,1653292684,1653159567,-490130802,-488967746,-472129362,-504782546,-504855777,-479686131,-500653556,-500653540,-500583896,-483724760,-529859288,-454391767,-453343109,-460683110,-460801894,-523721590,-532111158,-536284982,-469057286,-468041494,-415339287,-428987927,-1502709031,-1494332789,-1498723701,-1364599093,-1343687989,-1342639541,-1353125253,-1369709975,-1361550740,-1359468820,-1359401067,-1368782409,-1385558874,-332725082,-467073866,-467066722,-462872418,-454303586,1705946207,1739435021,1739368463,1726261519,2003090703,1898364223,1898896503,1898858999,1903040951,1903102901,1928268711,1928007335,1659524055,1651405057,1651359745,1651298352,1634525236,1617749300,1617657364,1617581572,1617822476,1617690940,1627144492,-526597656,-460403224,-460420375,-460539189,-460805558,-406275574,-435511782,-435514870,-434458086,-432430486,-416766742,-332864338,-462855010,-467136369,-449314676,-411434820,-486918996,-487711236,-491909556,-1297662388,-1314574754,-1331403042,-1331419458,-1867223378,-1865128218,-1873492250,-1877031966,-1870728894,-1334910973,-1251221504,-1217684480,-1238464208,-1238459904,-1238435264,-1238435136,-164962624,-160939292,-152554843,-152554843,-160816505,-227006553,-495432541,-512178014,-520181566,1626249218,1626258434,1617867778,1613144067,1613078545,1630315808,1647097120,1647887648,1645855012,1649098980,-498515796,-498577224,-431468104,-422871368,-439452935,-326206901,-325133814,-325190902,-325261286,-321363942,-331849717,-315027367,-282459672,-286653720,-290770323,-408411265,-443014838,-455596982,-523752214,-1312159574,-242333254,-242332790,-242693238,-203896438,-210193270,-247689078,-514031478,-511737638,-479293398,-479289297,-516956108,-516988924,-517332716,-265670364,-265681107,-265745553,-261551363,-202429699,-223465956,-760344052,-760409592,-760458744,-1834163640,-1834160391,-1048794390,-734094678,-734082390,-734115174,-734264694,-735833654,-731615144,-706453396,-676962068,-706322220,-706315068,-705299579,-671827289,-692802906,-151602258,-159990322,-164133426,-148527355,-181947884,-265903563,1613079061,1613025813,1613586999,1630500135,1664043055,-488028113,-475281153,-475346737,1656417487,1660592335,1658552523,1658437867,1657324393,1658377001,1650057769,1648026169,1646978313,1630137353,1613294601,1618988073,1625211945,1624916248,1616462088,1612198664,1631069704,1648045608,1652181736,-492877144,-493004101,-490964086,-507711350,-524758902,-1325797206,-1336254294,-1340464982,-1336270418,-254070018,-256171403,-240426444,-509057476,-504824292,-513218036,-517428468,-517297400,-482432744,-482505448,-484668408,-484651960,-516373031,-1591060821,-1607847250,-1602608466,-1535565138,-1260907890,-1265040690,-1265101603,-1262999508,-1767364564,-1767299044,-1767233528,-2039858168,-2039807928,-2039676584,-2035334167,-2018585878,-1800428886,-1796426054,-1871934886,-802317798,-802317602,-802243698,-802247794,-215374450,-232197698,-232210258,-232070994,-499457625,-495263065,-487918861,-1578437118,-1595281914,-1595349498,-1599547858,-1599540690,-1528278738,-1536667607,-1536663496,-1528171208,-1528115432,-1376073016,-1352992120,-1374819704,-1370702872,-1361794837,-1365994374,-1376464418,-1405688882,-1405689122,-1405717850,-1540488282,-1540422222,-1536358255,-1527965520,-1246947088,-1245889520,-1229118464,-1296161532,-222420212,-218214899,-218150370,-218314450,-243476434,-533149586,1614401790,1614606470,1612505222,1610924198,1611056038,1665553062,1648784066,1657152198,1652957710,1653940764,-225172952,-222556632,-254014936,-1336116648,-1340544520,-1327515400,-1262581624,-1262713717,-1129545526,-1112763910,-1074814230,-1104502038,-1104481558,-1104542994,-1104538642,-1372704282,-1351740058,-306377673,-325310193,-56874737,2123901709,1591421452,1448753692,1444545884,1444622556,1377304780,307773624,318349464,314227849,837458057,808356045,807897213,807902269,807776557,808755501,1882497837,1614710292,1613680132,1613430324,-516948444,-479404188,-475214236,-508768651,-458302778,-458298682,-319821114,-1402144538,-1402143642,-1402416026,-1402448786,-1402309522,-1402330779,-1511381404,-420788484,-420981060,-420976964,-429363304,-432509047,-432378742,-428189558,-487061318,-503838534,-252048246,-1326830453,-1326816055,-1326811784,-1330915800,-1263944152,-1263948260,-1263948275,-1247234545,-1251438034,-1255353818,-1590902490,-1607643034,-1607568130,-1607582610,-1595011730,-520222210,-503502454,-486790774,1650141322,1650133131,1918372009,1918373032,1925920168,1926960060,1929056861,1928016397,854155791,317219591,296677127,279879431,284088068,1349174020,1361658396,1361637928,1344840488,-253188824,-256272088,-256145144,-256075000,-256075256,-256599253,-503999190,-478822358,-499859414,-432246742,-465772246,-465640918,-463547846,-455161334,-304559606,-277288374,-281478450,-366425442,-1423289674,-1452650058,-1465225050,-1196805978,-1196805961,-1196810043,-1191564095,-1736823359,-1739051679,-1730663065,-1734859545,-1734860601,-1734709179,-1650801652,-1629830100,-1629760212,-1636258536,-1636257976,-1636258232,-1099330856,-1099329813,-1099389270,-1100438870,-1104620614,-1104625526,-30752630,-30744421,-47567719,-64345895,-60151605,-51770934,-190248598,-190050518,-190303942,-172416758,-172400370,-174464706,-174481362,-442978259,-438783892,-445075348,-449216264,-415526408,-417688968,-485846488,-519323096,-519388632,-519313880,-485986776,-480482520,-1562576856,-1564686295,-1547778981,-471187253,-528756533,-530919222,-523320342,-523348374,-523348374,-1588822455,-1559429559,-1555267976,-1570998680,-1571024312,-503573944,-453176632,-454151511,-458345558,-458280534,-454282102,-454280006,-177992534,-169354070,-190382902,-190530550,-190532342,-56319478,-51928550,-60382678,-64511190,-1121614486,-1087992598,-1367955222,-1359566597,-1363755831,-1094930360,-1099132856,-1103323064,-1103175320,-1103223832,-1103223828,-1099036756,-1075115099,-1079440458,-5698682,-559203962,-541251198,1475620274,1467250162,1463152706,1429315586,389128194,909353987,909288449,572689408,572687360,572686336,1663533088,1613201440,1613545508,1613512748,1613501736,1617763816,1626803177,1622482603,1622417066,1620850362,1692149386,1683304074,1691758234,-459928918,-457438790,-190314038,-139969462,-672455414,-731225330,-722803930,-727064286,-727142110,-189226974,-189161423,-169167856,-152396736,-227898176,-232092544,-232092544,-232078208,-232110159,-147974493,-198367581] from app.main.model.audio import Audio @@ -53,7 +58,8 @@ def test_simple_perl_function(): 'threshold': 10000, }, **{})).fetchall() -@manager.command +@click.command() +@with_appcontext def init_simple_perl_function(): with app.app_context(): sqlalchemy.event.listen( @@ -113,7 +119,8 @@ def init_simple_perl_function(): -@manager.command +@click.command() +@with_appcontext def init_perl_functions(): with app.app_context(): sqlalchemy.event.listen( @@ -239,7 +246,8 @@ def init_perl_functions(): ) db.create_all() -@manager.command +@click.command() +@with_appcontext def run(): """Runs the API server.""" port = os.getenv('ALEGRE_PORT', 3100) @@ -248,7 +256,8 @@ def run(): json_logging.init_request_instrument(app) app.run(host='0.0.0.0', port=port, threaded=True) -@manager.command +@click.command() +@with_appcontext def run_model(): """Runs the model server.""" if config_name == "test": @@ -262,12 +271,14 @@ def run_model(): ) -@manager.command +@click.command() +@with_appcontext def run_video_matcher(): """Runs the video matcher.""" VideoMatcher.start_server() -@manager.command +@click.command() +@with_appcontext def init(): """Initializes the service.""" # Create ES indexes. @@ -328,21 +339,23 @@ def init(): ) db.create_all() -@manager.command +@click.command() +@with_appcontext def test(pattern='test*.py'): """Runs the unit tests.""" tests = unittest.TestLoader().discover('app/test/', pattern=pattern) result = unittest.TextTestRunner(verbosity=2).run(tests) return 0 if result.wasSuccessful() else 1 -@manager.command -def phash(path): - """Computes the phash of a given image.""" - im = Image.open(path).convert('RGB') - phash = compute_phash_int(im) - print(phash, "{0:b}".format(phash), sep=" ") +# @app.cli.command() +# def phash(path): +# """Computes the phash of a given image.""" +# im = Image.open(path).convert('RGB') +# phash = compute_phash_int(im) +# print(phash, "{0:b}".format(phash), sep=" ") -@manager.command +@click.command() +@with_appcontext def run_rq_worker(): redis_server = redis.Redis(host=app.config['REDIS_HOST'], port=app.config['REDIS_PORT'], db=app.config['REDIS_DATABASE']) with Connection(redis_server): @@ -350,4 +363,5 @@ def run_rq_worker(): w = Worker(qs) w.work() if __name__ == '__main__': - manager.run() + # manager.run() + app.run() diff --git a/requirements.txt b/requirements.txt index f77c0991..082c7d9d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,154 +1,209 @@ -pgvector==0.1.8 -openai[embeddings]==0.27.4 -matplotlib==3.5.3 -plotly==5.14.1 -absl-py==0.9.0 -accumulation-tree==0.6 -alembic==1.0.1 -aniso8601==3.0.2 -asgiref==3.4.1 +absl-py==2.1.0 +accumulation-tree==0.6.2 +alembic==1.13.1 +aniso8601==9.0.1 +annotated-types==0.6.0 +anyio==4.3.0 +asgiref==3.8.1 astor==0.8.1 astunparse==1.6.3 -attrs==19.3.0 -bcrypt==3.1.4 -beautifulsoup4==4.9.3 -blinker==1.4 -blis==0.4.1 +async-timeout==4.0.3 +attrs==23.2.0 +bcrypt==4.1.3 +beautifulsoup4==4.12.3 +blinker==1.8.2 +blis==0.7.11 boto==2.49.0 -boto3==1.18.51 -botocore==1.21.51 +boto3==1.34.103 +botocore==1.34.103 bz2file==0.98 -cachetools==2.1.0 -certifi==2022.12.7 -cffi==1.11.5 -chardet==3.0.4 -charset-normalizer==2.0.4 -Click==7.0 -coverage==6.2 -cssselect==1.1.0 -cymem==2.0.2 -cytoolz==0.9.0.1 -dill==0.2.8.2 -docutils==0.14 -fastapi==0.68.0 +cachetools==5.3.3 +catalogue==2.0.10 +certifi==2024.2.2 +cffi==1.16.0 +chardet==5.2.0 +charset-normalizer==3.3.2 +click==8.1.7 +confection==0.1.4 +coverage==7.5.1 +cssselect==1.2.0 +cymem==2.0.8 +cytoolz==0.12.3 +dill==0.3.8 +distro==1.9.0 +dnspython==2.6.1 +docutils==0.21.2 +email_validator==2.1.1 +exceptiongroup==1.2.1 +fastapi==0.111.0 +fastapi-cli==0.0.3 feedfinder2==0.0.4 -feedparser==6.0.8 -filelock==3.0.12 -Flask==1.0.2 -Flask-Bcrypt==0.7.1 -Flask-Migrate==2.2.1 -flask-restplus==0.12.1 +feedparser==6.0.11 +filelock==3.14.0 +Flask==3.0.3 +Flask-Bcrypt==1.0.1 +Flask-CLI==0.4.0 +Flask-Migrate==4.0.7 +flask-restx==1.3.0 Flask-Script==2.0.6 -Flask-SQLAlchemy==2.4.1 -Flask-Testing==0.7.1 -gast==0.3.3 -google-api-core==1.16.0 -google-auth==1.6.3 -google-auth-oauthlib==0.4.1 -google-cloud-core==1.3.0 -google-cloud-translate==2.0.1 -google-cloud-vision==1.0.0 +Flask-SQLAlchemy==3.1.1 +Flask-Testing==0.8.1 +flatbuffers==24.3.25 +fsspec==2024.3.1 +gast==0.5.4 +google-api-core==2.19.0 +google-auth==2.29.0 +google-auth-oauthlib==1.2.0 +google-cloud-core==2.4.1 +google-cloud-translate==3.15.3 +google-cloud-vision==3.7.2 google-pasta==0.2.0 -googleapis-common-protos==1.51.0 -grpcio==1.27.2 -gunicorn==20.0.4 -h11==0.12.0 -h5py==2.10.0 -idna==2.7 -igraph==0.9.8 -ImageHash==4.0 -importlib-metadata==4.6.4 -itsdangerous==0.24 +googleapis-common-protos==1.63.0 +greenlet==3.0.3 +grpcio==1.63.0 +grpcio-status==1.62.2 +gunicorn==22.0.0 +h11==0.14.0 +h5py==3.11.0 +httpcore==1.0.5 +httptools==0.6.1 +httpx==0.27.0 +huggingface-hub==0.23.0 +idna==3.7 +igraph==0.11.5 +importlib_metadata==7.1.0 +importlib_resources==6.4.0 +itsdangerous==2.2.0 jieba3k==0.35.1 -Jinja2==2.11.3 -jmespath==0.9.3 -joblib==1.2.0 -json-logging==1.2.0 -jsonschema==2.6.0 +Jinja2==3.1.4 +jmespath==1.0.1 +joblib==1.4.2 +json-logging==1.3.0 +jsonschema==4.22.0 +jsonschema-specifications==2023.12.1 +keras==3.3.3 Keras-Applications==1.0.8 -Keras-Preprocessing==1.1.1 -# lxml==4.6.3 -Mako==1.2.2 -Markdown==3.2.1 -MarkupSafe==1.1.1 -msgpack==0.5.6 -msgpack-numpy==0.4.3.2 -murmurhash==1.0.1 -newspaper3k==0.2.8 -nltk==3.6.2 -numpy -oauthlib==3.1.0 -opensearch-py==2.2.0 -opt-einsum==3.2.0 -packaging==21.0 -pact-python==1.4.5 -# Pillow==8.1.1 -plac==0.9.6 -preshed==2.0.1 -protobuf==3.18.3 +Keras-Preprocessing==1.1.2 +libclang==18.1.1 +Mako==1.3.3 +Markdown==3.6 +markdown-it-py==3.0.0 +MarkupSafe==2.1.5 +mdurl==0.1.2 +ml-dtypes==0.3.2 +mpmath==1.3.0 +msgpack==1.0.8 +msgpack-numpy==0.4.8 +multidict==6.0.5 +murmurhash==1.0.10 +namex==0.0.8 +networkx==3.3 +numpy==1.26.4 +nvidia-cublas-cu12==12.1.3.1 +nvidia-cuda-cupti-cu12==12.1.105 +nvidia-cuda-nvrtc-cu12==12.1.105 +nvidia-cuda-runtime-cu12==12.1.105 +nvidia-cudnn-cu12==8.9.2.26 +nvidia-cufft-cu12==11.0.2.54 +nvidia-curand-cu12==10.3.2.106 +nvidia-cusolver-cu12==11.4.5.107 +nvidia-cusparse-cu12==12.1.0.106 +nvidia-nccl-cu12==2.20.5 +nvidia-nvjitlink-cu12==12.4.127 +nvidia-nvtx-cu12==12.1.105 +oauthlib==3.2.2 +openai==1.28.1 +opensearch-py==2.5.0 +opt-einsum==3.3.0 +optree==0.11.0 +orjson==3.10.3 +packaging==24.0 +pact-python==2.2.0 +pdqhashing @ file:///app/threatexchange/pdq/python +pgvector==0.2.5 +pillow==10.3.0 +plac==1.4.3 +preshed==3.0.9 +proto-plus==1.23.0 +protobuf==4.25.3 protobuf3-to-dict==0.1.5 -psutil==5.8.0 -psycopg2==2.8.4 -pyasn1==0.4.4 -pyasn1-modules==0.2.2 +psutil==5.9.8 +psycopg2==2.9.9 +pyasn1==0.6.0 +pyasn1_modules==0.4.0 pycld3==0.22 -pycparser==2.19 -pydantic==1.8.2 -PyJWT==2.4.0 -pyparsing==2.4.7 -python-dateutil==2.7.3 -python-editor==1.0.3 -pytz==2018.5 +pycparser==2.22 +pydantic==2.7.1 +pydantic_core==2.18.2 +Pygments==2.18.0 +PyJWT==2.8.0 +pyparsing==3.1.2 +python-dateutil==2.9.0.post0 +python-dotenv==1.0.1 +python-editor==1.0.4 +python-multipart==0.0.9 +pytz==2024.1 pyudorandom==1.0.0 -PyWavelets==1.1.1 -PyYAML==5.4.1 -redis>=3.5.0 -regex==2018.1.10 -requests==2.26.0 -requests-file==1.5.1 -requests-oauthlib==1.3.0 -rq==1.10.0 -rsa==4.7 -s3transfer==0.5.0 -sacremoses==0.0.45 -scikit-learn==1.0.2 -scipy==1.2.1 -sentence-transformers==2.2.0 -sentencepiece==0.1.96 +PyWavelets==1.6.0 +PyYAML==6.0.1 +redis==5.0.4 +referencing==0.35.1 +regex==2024.5.10 +requests==2.31.0 +requests-file==2.0.0 +requests-oauthlib==2.0.0 +rich==13.7.1 +rpds-py==0.18.1 +rq==1.16.2 +rsa==4.9 +s3transfer==0.10.1 +sacremoses==0.1.1 +safetensors==0.4.3 +scikit-learn==1.4.2 +scipy==1.13.0 +sentence-transformers==2.7.0 +sentencepiece==0.2.0 +sentry-sdk==2.1.1 sgmllib3k==1.0.0 -six==1.12.0 -smart-open==1.7.1 -soupsieve==2.2.1 -SQLAlchemy==1.3.15 -SQLAlchemy-Utils==0.36.1 -srsly==1.0.5 -starlette==0.14.2 +shellingham==1.5.4 +six==1.16.0 +smart-open==7.0.4 +sniffio==1.3.1 +soupsieve==2.5 +SQLAlchemy==2.0.30 +SQLAlchemy-Utils==0.41.2 +srsly==2.4.8 +starlette==0.37.2 +sympy==1.12 tdigest==0.5.2.2 -tenacity==8.0.1 -tensorboard==2.3.0 -tensorboard-plugin-wit==1.8.0 -tensorflow==2.3.1 -tensorflow-estimator==2.3.0 -tensorflow-hub==0.8.0 -tensorflow-text==2.3.0 -termcolor==1.1.0 -thinc==7.3.1 -threadpoolctl==2.2.0 -tinysegmenter==0.3 -tldextract==3.1.0 +tenacity==8.3.0 +tensorboard==2.16.2 +tensorboard-data-server==0.7.2 +tensorflow==2.16.1 +tensorflow-io-gcs-filesystem==0.37.0 +termcolor==2.4.0 +texttable==1.7.0 +thinc==9.0.0 +threadpoolctl==3.5.0 +tinysegmenter==0.4 +tldextract==5.1.2 tmkpy==0.1.1 -tokenizers -toolz==0.9.0 -torch==1.9.0 -tqdm==4.27.0 -transformers==4.6.0 -twitter-text-parser==1.0.0 -typing-extensions==3.10.0.0 -ujson==5.4.0 -urllib3==1.26.7 -uvicorn==0.15.0 -wasabi==0.8.2 -Werkzeug==0.16.0 -wrapt==1.11.1 -zipp==3.5.0 -sentry-sdk[flask]==1.5.12 \ No newline at end of file +tokenizers==0.19.1 +toolz==0.12.1 +torch==2.3.0 +tqdm==4.66.4 +transformers==4.40.2 +triton==2.3.0 +typer==0.12.3 +typing_extensions==4.11.0 +ujson==5.9.0 +urllib3==1.26.18 +uvicorn==0.29.0 +uvloop==0.19.0 +wasabi==1.1.2 +watchfiles==0.21.0 +websockets==12.0 +Werkzeug==3.0.3 +wrapt==1.16.0 +yarl==1.9.4 +zipp==3.18.1 From e02d74a584d0246228f9224d30c423b840192ae5 Mon Sep 17 00:00:00 2001 From: computermacgyver Date: Sun, 12 May 2024 09:38:14 +0100 Subject: [PATCH 2/2] copy pdq/python --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index abdc219c..8d4fcd50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ RUN ln -s /usr/bin/ffmpeg /usr/local/bin/ffmpeg # Copy necessary threatexchange folders COPY ./threatexchange/tmk/cpp /app/threatexchange/tmk/cpp COPY ./threatexchange/pdq/cpp /app/threatexchange/pdq/cpp +COPY ./threatexchange/pdq/python /app/threatexchange/pdq/python RUN make -C /app/threatexchange/tmk/cpp # Other configurations