Enable model variables & start working on RAG task

This commit is contained in:
Josako
2024-05-25 20:17:02 +02:00
parent e483d6cf90
commit ce91323dc9
15 changed files with 340 additions and 46 deletions

View File

@@ -1,23 +0,0 @@
from .tasks import create_embeddings
from celery import Celery, Task
def init_celery(app):
class ContextTask(Task):
def __call__(self, *args, **kwargs):
with app.app_context():
return self.run(*args, **kwargs)
celery_app = Celery(app.import_name, task_cls=ContextTask)
celery_app.conf.broker_url = app.config.get('CELERY_BROKER_URL')
celery_app.conf.result_backend = app.config.get('CELERY_RESULT_BACKEND')
celery_app.conf.accept_content = app.config.get('CELERY_ACCEPT_CONTENT')
celery_app.conf.task_serializer = app.config.get('CELERY_TASK_SERIALIZER')
celery_app.conf.timezone = app.config.get('CELERY_TIMEZONE')
celery_app.conf.enable_utc = app.config.get('CELERY_ENABLE_UTC')
celery_app.set_default()
app.extensions['celery'] = celery_app