Spaces:
Running
Running
ddovidovich
commited on
Commit
·
be55b3c
1
Parent(s):
f29a842
Update app.py
Browse files
app.py
CHANGED
@@ -81,7 +81,18 @@ def main():
|
|
81 |
|
82 |
# Кнопка "Answer LLM"
|
83 |
if st.button("LLM Answer"):
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
text_output = ""
|
86 |
for out in output:
|
87 |
stream = copy.deepcopy(out)
|
|
|
81 |
|
82 |
# Кнопка "Answer LLM"
|
83 |
if st.button("LLM Answer"):
|
84 |
+
question = input_text.lower()
|
85 |
+
context = dataList[0]["Answer"]
|
86 |
+
text_input = f'''
|
87 |
+
[INST]<<SYS>> Вы помощник в вопросах-ответах. Используйте следующий фрагменты полученного контекста, чтобы ответить на вопрос. Если вы не знаете ответа, просто скажите, что не знаете. Используйте максимум три предложения и будьте краткими.<</SYS>>
|
88 |
+
|
89 |
+
Вопрос: {question}
|
90 |
+
|
91 |
+
Контекст: {context}
|
92 |
+
|
93 |
+
Ответ: [/INST]
|
94 |
+
'''
|
95 |
+
output = llm(text_input, max_tokens=512, stream=True)
|
96 |
text_output = ""
|
97 |
for out in output:
|
98 |
stream = copy.deepcopy(out)
|