Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,6 +11,9 @@ from langchain.chat_models.gigachat import GigaChat
|
|
| 11 |
from htmlTemplates import css, bot_template, user_template
|
| 12 |
from langchain.llms import HuggingFaceHub, LlamaCpp
|
| 13 |
from huggingface_hub import snapshot_download, hf_hub_download
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# from prompts import CONDENSE_QUESTION_PROMPT
|
| 16 |
|
|
@@ -65,9 +68,8 @@ def get_conversation_chain(vectorstore, model_name):
|
|
| 65 |
|
| 66 |
#llm = ChatOpenAI()
|
| 67 |
|
| 68 |
-
llm = GigaChat(
|
| 69 |
-
|
| 70 |
-
)
|
| 71 |
|
| 72 |
memory = ConversationBufferMemory(memory_key='chat_history',
|
| 73 |
input_key='question',
|
|
|
|
| 11 |
from htmlTemplates import css, bot_template, user_template
|
| 12 |
from langchain.llms import HuggingFaceHub, LlamaCpp
|
| 13 |
from huggingface_hub import snapshot_download, hf_hub_download
|
| 14 |
+
import os
|
| 15 |
+
|
| 16 |
+
credentials = os.getenv("GIGACHAT_CREDENTIALS")
|
| 17 |
|
| 18 |
# from prompts import CONDENSE_QUESTION_PROMPT
|
| 19 |
|
|
|
|
| 68 |
|
| 69 |
#llm = ChatOpenAI()
|
| 70 |
|
| 71 |
+
llm = GigaChat(credentials=credentials,
|
| 72 |
+
verify_ssl_certs=False, streaming=True)
|
|
|
|
| 73 |
|
| 74 |
memory = ConversationBufferMemory(memory_key='chat_history',
|
| 75 |
input_key='question',
|