From 15ba223f9c35c01823b54a34136d80d3ddfb2061 Mon Sep 17 00:00:00 2001 From: Stan Girard Date: Sat, 20 Jan 2024 13:51:03 -0800 Subject: [PATCH] chore(docker): increased number of replicas --- backend/llm/knowledge_brain_qa.py | 2 -- backend/llm/qa_headless.py | 1 - backend/modules/chat/controller/chat/brainful_chat.py | 10 +--------- backend/vectorstore/supabase.py | 3 --- docker-compose.dev.yml | 2 +- docker-compose.yml | 2 +- 6 files changed, 3 insertions(+), 17 deletions(-) diff --git a/backend/llm/knowledge_brain_qa.py b/backend/llm/knowledge_brain_qa.py index a7e9328f6..220f8cc4b 100644 --- a/backend/llm/knowledge_brain_qa.py +++ b/backend/llm/knowledge_brain_qa.py @@ -313,8 +313,6 @@ class KnowledgeBrainQA(BaseModel, QAInterface): # Combine all response tokens to form the final assistant message assistant = "".join(response_tokens) - logger.info("💋💋💋💋") - logger.info(streamed_chat_history) try: if save_answer: diff --git a/backend/llm/qa_headless.py b/backend/llm/qa_headless.py index 1cb83f403..272cfc87f 100644 --- a/backend/llm/qa_headless.py +++ b/backend/llm/qa_headless.py @@ -246,7 +246,6 @@ class HeadlessQA(BaseModel, QAInterface): ) async for token in callback.aiter(): - logger.info("Token: %s", token) response_tokens.append(token) streamed_chat_history.assistant = token yield f"data: {json.dumps(streamed_chat_history.dict())}" diff --git a/backend/modules/chat/controller/chat/brainful_chat.py b/backend/modules/chat/controller/chat/brainful_chat.py index 13b4e276e..6b7d80d51 100644 --- a/backend/modules/chat/controller/chat/brainful_chat.py +++ b/backend/modules/chat/controller/chat/brainful_chat.py @@ -66,22 +66,14 @@ class BrainfulChat(ChatInterface): supabase_client, embeddings, table_name="vectors" ) # Get the first question from the chat_question - logger.info(f"Finding brain closest to {chat_question}") - logger.info("🔥🔥🔥🔥🔥") + question = chat_question.question - logger.info(f"Question is {question}") history = chat_service.get_chat_history(chat_id) if history: question = history[0].user_message - logger.info(f"Question is {question}") brain_id_to_use = vector_store.find_brain_closest_query(question) - logger.info(f"Found brain {brain_id_to_use}") - logger.info("🧠🧠🧠") brain = brain_service.get_brain_by_id(brain_id_to_use) - logger.info(f"Brain type: {brain.brain_type}") - logger.info(f"Id is {brain.brain_id}") - logger.info(f"Type of brain_id is {type(brain.brain_id)}") if ( brain and brain.brain_type == BrainType.DOC diff --git a/backend/vectorstore/supabase.py b/backend/vectorstore/supabase.py index ad306736d..1e6e8febb 100644 --- a/backend/vectorstore/supabase.py +++ b/backend/vectorstore/supabase.py @@ -43,9 +43,6 @@ class CustomSupabaseVectorStore(SupabaseVectorStore): ).execute() # Get the brain_id of the brain that is most similar to the query - logger.info(f"Found {len(res.data)} brains") - logger.info(res.data) - logger.info("🔥🔥🔥🔥🔥") brain_id = res.data[0].get("id", None) if not brain_id: return None diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 51d3d10f1..35ee22b63 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -23,7 +23,7 @@ services: - "--port" - "5050" - "--workers" - - "2" + - "6" restart: always ports: diff --git a/docker-compose.yml b/docker-compose.yml index 74b6b6b43..fa8b895b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,7 +41,7 @@ services: - "--port" - "5050" - "--workers" - - "1" + - "6" restart: always volumes: - ./backend/:/code/