ddovidovich commited on
Commit
f29a842
·
1 Parent(s): 94899d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -76,14 +76,18 @@ def main():
76
  st.write("Most relevants answers")
77
  st.table(dataList)
78
 
 
 
 
79
  # Кнопка "Answer LLM"
80
  if st.button("LLM Answer"):
81
- st.write("LLAMA generated answer:")
82
  output = llm('Что ты можешь рассказать про поэта Пушкина?', max_tokens=512, stream=True)
 
83
  for out in output:
84
  stream = copy.deepcopy(out)
85
- text_output = st.text_area("", stream["choices"][0]["text"])
86
- pass
 
87
 
88
 
89
  # Запуск основной части приложения
 
76
  st.write("Most relevants answers")
77
  st.table(dataList)
78
 
79
+ # Текстовое поле для вывода ответа LLM
80
+ llm_output_text = st.empty()
81
+
82
  # Кнопка "Answer LLM"
83
  if st.button("LLM Answer"):
 
84
  output = llm('Что ты можешь рассказать про поэта Пушкина?', max_tokens=512, stream=True)
85
+ text_output = ""
86
  for out in output:
87
  stream = copy.deepcopy(out)
88
+ text_output += stream["choices"][0]["text"]
89
+ llm_output_text.text("LLAMA generated answer:")
90
+ llm_output_text.text(text_output)
91
 
92
 
93
  # Запуск основной части приложения