Wedyan2023 commited on
Commit
fb32ff7
·
verified ·
1 Parent(s): 325f6c9

Update app8.py

Browse files
Files changed (1) hide show
  1. app8.py +17 -2
app8.py CHANGED
@@ -388,7 +388,22 @@ if "task_choice" in st.session_state:
388
  else:
389
  st.warning("Please enter at least one example to classify.")
390
 
 
 
 
 
 
391
  if st.session_state.messages:
392
  st.markdown("### Output:")
393
- for message in st.session_state.messages[-1:]:
394
- st.markdown(message["content"])
 
 
 
 
 
 
 
 
 
 
 
388
  else:
389
  st.warning("Please enter at least one example to classify.")
390
 
391
+ ##if st.session_state.messages:
392
+ ##st.markdown("### Output:")
393
+ ##for message in st.session_state.messages[-1:]:
394
+ ##st.markdown(message["content"])
395
+
396
  if st.session_state.messages:
397
  st.markdown("### Output:")
398
+ last_message = st.session_state.messages[-1]["content"]
399
+
400
+ # Find the position of "Output:" if it exists
401
+ output_start = last_message.find("Output:")
402
+
403
+ if output_start != -1:
404
+ # Display only the content after "Output:"
405
+ cleaned_output = last_message[output_start + 7:].strip()
406
+ st.markdown(cleaned_output)
407
+ else:
408
+ # If "Output:" is not found, display the content as is
409
+ st.markdown(last_message)