awacke1 commited on
Commit
cccfd4c
·
1 Parent(s): 872f8a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -200,17 +200,17 @@ def chat_with_model(prompt, document_section, model_choice='Llama-2-7b-chat-hf')
200
  collected_chunks.append(r.token.text)
201
  chunk_message = r.token.text
202
  collected_messages.append(chunk_message)
203
- try:
204
- report.append(r.token.text)
205
- if len(r.token.text) > 0:
206
- result="".join(report).strip()
207
- res_box.markdown(f'*{result}*')
208
-
209
- except:
210
- st.write('Stream llm issue')
211
  st.write("Elapsed time:")
212
  st.write(time.time() - start_time)
213
- filename = generate_filename(full_reply_content, choice)
214
  create_file(filename, prompt, full_reply_content, should_save)
215
  readitaloud(full_reply_content)
216
  return result
 
200
  collected_chunks.append(r.token.text)
201
  chunk_message = r.token.text
202
  collected_messages.append(chunk_message)
203
+ #try:
204
+ report.append(r.token.text)
205
+ if len(r.token.text) > 0:
206
+ result="".join(report).strip()
207
+ res_box.markdown(f'*{result}*')
208
+
209
+ #except:
210
+ st.write('Stream llm issue')
211
  st.write("Elapsed time:")
212
  st.write(time.time() - start_time)
213
+ filename = generate_filename(full_reply_content, prompt)
214
  create_file(filename, prompt, full_reply_content, should_save)
215
  readitaloud(full_reply_content)
216
  return result