Shroogawh24 commited on
Commit
1465f45
1 Parent(s): ab32827

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -10
app.py CHANGED
@@ -9,16 +9,9 @@ from langchain.chains import LLMChain
9
  from langchain.output_parsers import StrOutputParser
10
  from langchain.chat_models import ChatOpenAI
11
 
12
- # Set up the Hugging Face model and embeddings
13
- model_name = "BAAI/bge-large-en-v1.5"
14
- model_kwargs = {'device':'cuda'}
15
- encode_kwargs = {'normalize_embeddings':True}
16
-
17
- embedding_function = HuggingFaceBgeEmbeddings(
18
- model_name = model_name,
19
- model_kwargs = model_kwargs,
20
- encode_kwargs = encode_kwargs
21
- )
22
 
23
  # Set the OpenAI API key
24
  openai.api_key = os.getenv("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")
 
9
  from langchain.output_parsers import StrOutputParser
10
  from langchain.chat_models import ChatOpenAI
11
 
12
+ from sentence_transformers import SentenceTransformer
13
+
14
+ embedding_function = SentenceTransformer("BAAI/bge-large-en-v1.5")
 
 
 
 
 
 
 
15
 
16
  # Set the OpenAI API key
17
  openai.api_key = os.getenv("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")