Yashvj123 commited on
Commit
dbd7162
Β·
verified Β·
1 Parent(s): 13e89b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -233,8 +233,15 @@ if uploaded_file:
233
  if st.button("πŸ” Analyze Extracted Text"):
234
  with st.spinner("Analyzing with LLM..."):
235
  response = chain.run(prescription_text=text)
 
 
 
 
 
 
 
236
  st.markdown("#### πŸ’‘ AI-based Medicine Analysis")
237
- st.text_area("LLM Output", response, height=300)
238
 
239
  # Save txt and image
240
  txt_path = "medicine_analysis.txt"
 
233
  if st.button("πŸ” Analyze Extracted Text"):
234
  with st.spinner("Analyzing with LLM..."):
235
  response = chain.run(prescription_text=text)
236
+ parts = response.split("</think>")
237
+
238
+ if len(parts) > 1:
239
+ filtered_output = parts[1].strip()
240
+ else:
241
+ filtered_output = full_output
242
+
243
  st.markdown("#### πŸ’‘ AI-based Medicine Analysis")
244
+ st.text_area("LLM Output", filtered_output, height=300)
245
 
246
  # Save txt and image
247
  txt_path = "medicine_analysis.txt"