GSMK commited on
Commit
2cb2a72
·
verified ·
1 Parent(s): 7ea06f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -247,7 +247,7 @@ templates = {
247
  # EXPLANATION BLOCK
248
  # --------------------------------------------------
249
 
250
- explanations = {
251
 
252
  "medical": {
253
  "pneumonia":
@@ -493,4 +493,12 @@ if uploaded_file:
493
  caption = blip_processor.decode(caption_ids[0], skip_special_tokens=True)
494
 
495
  st.subheader("Image Description (BLIP)")
496
- st.write(caption)
 
 
 
 
 
 
 
 
 
247
  # EXPLANATION BLOCK
248
  # --------------------------------------------------
249
 
250
+ EXPLANATIONS = {
251
 
252
  "medical": {
253
  "pneumonia":
 
493
  caption = blip_processor.decode(caption_ids[0], skip_special_tokens=True)
494
 
495
  st.subheader("Image Description (BLIP)")
496
+ st.write(caption)
497
+
498
+ explanation = EXPLANATIONS.get(predicted_class,"No explanation available.")
499
+
500
+ st.subheader("Detailed Explanation")
501
+
502
+ for line in explanation.strip().split("\n"):
503
+ if line.strip():
504
+ st.write(line.strip())