Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ run_model:
run_rq_worker:
while true; do python manage.py run_rq_worker; done

run_video_matcher:
while true; do python manage.py run_video_matcher; done

test: wait
python manage.py init_perl_functions
coverage run --source=app/main/ manage.py test
Expand Down
3 changes: 1 addition & 2 deletions app/main/lib/shared_models/video_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import tmkpy
from sqlalchemy.orm.exc import NoResultFound

from app.main.lib.shared_models.shared_model import SharedModel
from app.main.lib.similarity_helpers import get_context_query, drop_context_from_record
from app.main.lib.helpers import context_matches
from app.main.lib import media_crud
Expand All @@ -28,7 +27,7 @@
def _after_log(retry_state):
app.logger.debug("Retrying video similarity...")

class VideoModel(SharedModel):
class VideoModel():
def overload_context_to_denote_content_type(self, task):
return {**task, **{"context": {**task.get("context", {}), **{"content_type": "video"}}}}

Expand Down
2 changes: 1 addition & 1 deletion app/main/lib/similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def audio_model():
return AudioModel(app.config['AUDIO_MODEL'])

def video_model():
return VideoModel(app.config['VIDEO_MODEL'])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are not reading VIDEO_MODEL config anymore, can we remove it from config?

VIDEO_MODEL = os.getenv('VIDEO_MODEL', 'video-model')
. Or are there other things that read this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we can safely remove I think.

return VideoModel()

def model_response_package(item, command):
response_package = {
Expand Down
2 changes: 1 addition & 1 deletion app/test/test_video_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def respond(self, task):
class TestVideoSimilarityBlueprint(BaseTestCase):
def setUp(self):
super().setUp()
self.model = VideoModel('video')
self.model = VideoModel()

def test_get_tempfile(self):
self.assertIsInstance(self.model.get_tempfile(), tempfile._TemporaryFileWrapper)
Expand Down
12 changes: 0 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,6 @@ services:
# - .env_file
# environment:
# MODEL_NAME: mdebertav3filipino
# video:
# build: .
# platform: linux/x86_64
# command: ["make", "run_model"]
# volumes:
# - ".:/app"
# depends_on:
# - redis
# env_file:
# - .env_file
# environment:
# MODEL_NAME: video
# audio:
# build: .
# platform: linux/x86_64
Expand Down
6 changes: 0 additions & 6 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,6 @@ def run_model():
model_config['options']
)


@manager.command
def run_video_matcher():
"""Runs the video matcher."""
VideoMatcher.start_server()

@manager.command
def init():
"""Initializes the service."""
Expand Down
Loading