debug
Browse files- App/Embedding/utils/Initialize.py +0 -18
- App/Worker.py +4 -1
- Dockerfile +1 -1
App/Embedding/utils/Initialize.py
CHANGED
@@ -62,23 +62,5 @@ def search(query: str, task_id: str):
|
|
62 |
|
63 |
|
64 |
def encode(temp: list[Document]):
|
65 |
-
from langchain.vectorstores import Pinecone
|
66 |
-
import pinecone
|
67 |
-
import os
|
68 |
-
|
69 |
-
# get api key from app.pinecone.io
|
70 |
-
PINECONE_API_KEY = os.environ.get("PINECONE_API_KEY")
|
71 |
-
# find your environment next to the api key in pinecone console
|
72 |
-
PINECONE_ENV = os.environ.get("PINECONE_ENVIRONMENT")
|
73 |
-
|
74 |
-
|
75 |
-
index_name = "transcript-bits"
|
76 |
-
model_name = "thenlper/gte-base"
|
77 |
-
embeddings = HuggingFaceEmbeddings(model_name=model_name)
|
78 |
-
|
79 |
-
|
80 |
-
pinecone.init(api_key=PINECONE_API_KEY, environment=PINECONE_ENV)
|
81 |
-
vector_index = pinecone.Index(index_name=index_name)
|
82 |
-
docsearch = Pinecone.from_existing_index(index_name, embeddings)
|
83 |
docsearch.add_documents(temp)
|
84 |
# return embeddings.embed_documents(texts = [d.page_content for d in temp])
|
|
|
62 |
|
63 |
|
64 |
def encode(temp: list[Document]):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
docsearch.add_documents(temp)
|
66 |
# return embeddings.embed_documents(texts = [d.page_content for d in temp])
|
App/Worker.py
CHANGED
@@ -9,7 +9,10 @@ from App.Embedding.utils.Initialize import encode, generateChunks
|
|
9 |
|
10 |
celery = Celery()
|
11 |
celery.config_from_object(celery_config)
|
12 |
-
|
|
|
|
|
|
|
13 |
|
14 |
@celery.task(name="embbeding", bind=True)
|
15 |
def generate_store(self, data, task_id):
|
|
|
9 |
|
10 |
celery = Celery()
|
11 |
celery.config_from_object(celery_config)
|
12 |
+
celery.conf.update(
|
13 |
+
# Other Celery configuration settings
|
14 |
+
CELERYD_LOG_LEVEL='DEBUG', # Set log level to DEBUG for the worker
|
15 |
+
)
|
16 |
|
17 |
@celery.task(name="embbeding", bind=True)
|
18 |
def generate_store(self, data, task_id):
|
Dockerfile
CHANGED
@@ -22,7 +22,7 @@ USER admin
|
|
22 |
COPY --chown=admin . /srv
|
23 |
|
24 |
# Command to run the application
|
25 |
-
CMD uvicorn App.app:app --host 0.0.0.0 --port 7860 --workers 4 & celery -A App.Worker.celery worker -c 4 --loglevel=
|
26 |
|
27 |
# Expose the server port
|
28 |
EXPOSE 7860
|
|
|
22 |
COPY --chown=admin . /srv
|
23 |
|
24 |
# Command to run the application
|
25 |
+
CMD uvicorn App.app:app --host 0.0.0.0 --port 7860 --workers 4 & celery -A App.Worker.celery worker -c 4 --loglevel=DEBUG
|
26 |
|
27 |
# Expose the server port
|
28 |
EXPOSE 7860
|