From 31797413e28dd1ef983ac869ba692afcc154aff2 Mon Sep 17 00:00:00 2001 From: Ted Johnson Date: Wed, 5 Jun 2024 13:58:37 -0600 Subject: [PATCH] Issue 159 update requiremnts to specify working versions --- chains.py | 4 ++-- requirements.txt | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/chains.py b/chains.py index 9ad10f40..f27677ae 100644 --- a/chains.py +++ b/chains.py @@ -2,7 +2,7 @@ from langchain_openai import OpenAIEmbeddings from langchain_community.embeddings import OllamaEmbeddings from langchain_community.embeddings import BedrockEmbeddings -from langchain_community.embeddings.sentence_transformer import SentenceTransformerEmbeddings +from langchain_community.embeddings.huggingface import HuggingFaceEmbeddings from langchain_openai import ChatOpenAI from langchain_community.chat_models import ChatOllama @@ -48,7 +48,7 @@ def load_embedding_model(embedding_model_name: str, logger=BaseLogger(), config= dimension = 768 logger.info("Embedding: Using Google Generative AI Embeddings") else: - embeddings = SentenceTransformerEmbeddings( + embeddings = HuggingFaceEmbeddings( model_name="all-MiniLM-L6-v2", cache_folder="/embedding_model" ) dimension = 384 diff --git a/requirements.txt b/requirements.txt index ad0f6f90..93d867fc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ wikipedia tiktoken neo4j streamlit -sentence_transformers==2.2.2 +sentence_transformers==2.6.0 Pillow fastapi PyPDF2 @@ -14,6 +14,9 @@ uvicorn sse-starlette boto3 # missing from the langchain base image? + langchain-huggingface==0.0.2 +langchain-core==0.2.1 langchain-openai -langchain-community +langchain-community==0.2.1 langchain-google-genai +# Do more of these versions need to be fixed?