Spaces:
Runtime error
Runtime error
Commit
•
29d059a
1
Parent(s):
cf9eeeb
Update app.py
Browse files
app.py
CHANGED
@@ -31,14 +31,14 @@ def get_text_chunks(text):
|
|
31 |
|
32 |
def get_vectorstore(text_chunks):
|
33 |
#embeddings = OpenAIEmbeddings()
|
34 |
-
embeddings =
|
35 |
vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
|
36 |
return vectorstore
|
37 |
|
38 |
|
39 |
def get_conversation_chain(vectorstore):
|
40 |
#llm = ChatOpenAI()
|
41 |
-
llm = HuggingFaceHub(repo_id="
|
42 |
|
43 |
memory = ConversationBufferMemory(
|
44 |
memory_key='chat_history', return_messages=True)
|
|
|
31 |
|
32 |
def get_vectorstore(text_chunks):
|
33 |
#embeddings = OpenAIEmbeddings()
|
34 |
+
embeddings = HuggingFaceBgeEmbeddings(model_name="BAAI/bge-small-en-v1.5")
|
35 |
vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
|
36 |
return vectorstore
|
37 |
|
38 |
|
39 |
def get_conversation_chain(vectorstore):
|
40 |
#llm = ChatOpenAI()
|
41 |
+
llm = HuggingFaceHub(repo_id="deepset/roberta-base-squad2", model_kwargs={"temperature":0.5, "max_length":512})
|
42 |
|
43 |
memory = ConversationBufferMemory(
|
44 |
memory_key='chat_history', return_messages=True)
|