Spaces:
Running
Running
Update app.py
Browse files
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",
|
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"
|