Spaces:
Sleeping
Sleeping
Update app.py
Browse files279 unmodified lines28028128228328428528628763 unmodified lines351352353354355356357279 unmodified linesWhat features of the chest X-ray image support the predicted condition(s)?"""def predictionReportGenerator(vlm_model, image_path, system_prompt, query_prompt):image_ = Image.open(image_path).convert("RGB")messages = [{"role": "system",63 unmodified linesformatted_predictions = {label: output_probs[label] for label in predicted_classes}query_prompt = generate_query(formatted_predictions)explanation_ = predictionReportGenerator(vlm_model = VLM_model, image_path = input_image,system_prompt = VLM_SYSTEM_PROMPT, query_prompt = query_prompt)return "\n".join(predicted_classes), explanation_, output_probs279 unmodified lines28028128228328428528628728828963 unmodified lines353354355356357358359279 unmodified linesWhat features of the chest X-ray image support the predicted condition(s)?"""def predictionReportGenerator(vlm_model, img_pil, system_prompt, query_prompt):# image_ = Image.open(image_path).convert("RGB")image_ = img_pil.convert("RGB")messages = [{"role": "system",63 unmodified linesformatted_predictions = {label: output_probs[label] for label in predicted_classes}query_prompt = generate_query(formatted_predictions)explanation_ = predictionReportGenerator(vlm_model = VLM_model, img_pil = input_image,system_prompt = VLM_SYSTEM_PROMPT, query_prompt = query_prompt)return "\n".join(predicted_classes), explanation_, output_probs
app.py+5-3