cvips commited on
Commit
7978786
·
1 Parent(s): ccd6eeb

biomedparse+biomedllama_3b_multimodal

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -432,11 +432,23 @@ def process_image(image_path, user_prompt, modality=None):
432
  stream=True
433
  ):
434
  detailed_analysis += new_text
 
 
 
 
 
 
 
 
435
  except Exception as e:
436
  print(f"LLM chat error: {str(e)}")
437
  detailed_analysis = "LLM analysis failed. Proceeding with basic analysis."
 
 
438
  else:
439
  detailed_analysis = "LLM not available. Please check LLM initialization logs."
 
 
440
 
441
  return results, detailed_analysis, detected_modality
442
 
 
432
  stream=True
433
  ):
434
  detailed_analysis += new_text
435
+
436
+ # Add segmentation details in a more natural way
437
+ detailed_analysis += "\n\nIn the segmentation analysis:"
438
+ if color_descriptions:
439
+ detailed_analysis += " " + " ".join(color_descriptions) + "."
440
+ else:
441
+ detailed_analysis += " No significant segments were detected."
442
+
443
  except Exception as e:
444
  print(f"LLM chat error: {str(e)}")
445
  detailed_analysis = "LLM analysis failed. Proceeding with basic analysis."
446
+ if color_descriptions:
447
+ detailed_analysis += "\n\nHowever, in the segmentation analysis: " + " ".join(color_descriptions) + "."
448
  else:
449
  detailed_analysis = "LLM not available. Please check LLM initialization logs."
450
+ if color_descriptions:
451
+ detailed_analysis += "\n\nIn the segmentation analysis: " + " ".join(color_descriptions) + "."
452
 
453
  return results, detailed_analysis, detected_modality
454