Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
st.write("Elapsed time:")
|
212 |
st.write(time.time() - start_time)
|
213 |
-
filename = generate_filename(full_reply_content,
|
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
|