Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,8 @@ def get_text_chunks(text):
|
|
43 |
|
44 |
def get_vectorstore(text_chunks):
|
45 |
#embeddings = OpenAIEmbeddings()
|
46 |
-
embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-xl")
|
|
|
47 |
#embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/paraphrase-multilingual-mpnet-base-v2")
|
48 |
vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
|
49 |
|
@@ -64,7 +65,10 @@ def get_conversation_chain(vectorstore, model_name):
|
|
64 |
|
65 |
#llm = ChatOpenAI()
|
66 |
|
67 |
-
llm = GigaChat(profanity=False,
|
|
|
|
|
|
|
68 |
|
69 |
memory = ConversationBufferMemory(memory_key='chat_history',
|
70 |
input_key='question',
|
|
|
43 |
|
44 |
def get_vectorstore(text_chunks):
|
45 |
#embeddings = OpenAIEmbeddings()
|
46 |
+
#embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-xl")
|
47 |
+
embeddings = HuggingFaceEmbeddings(model_name="intfloat/multilingual-e5-large")
|
48 |
#embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/paraphrase-multilingual-mpnet-base-v2")
|
49 |
vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
|
50 |
|
|
|
65 |
|
66 |
#llm = ChatOpenAI()
|
67 |
|
68 |
+
llm = GigaChat(profanity=False,
|
69 |
+
credentials='OTg2NDNkMGYtMDQ1My00YTJmLWFlYzctYjlkOTY0NTRmYzM0OjNlYjRhZTA0LTY4Y2ItNDU3Ni1hYTEwLTU5ZmJmZmIxZjM5NA==',
|
70 |
+
verify_ssl_certs=False
|
71 |
+
)
|
72 |
|
73 |
memory = ConversationBufferMemory(memory_key='chat_history',
|
74 |
input_key='question',
|