Faisal commited on
Commit
5790447
Β·
1 Parent(s): 2eec5d5

Restore GPU version - remove CPU optimizations and restore GPU-compatible dependencies

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -98,6 +98,12 @@ def process_pipeline(image, user_question):
98
  clean_up_tokenization_spaces=False
99
  )[0]
100
 
 
 
 
 
 
 
101
  # Send MedVLM output to DeepSeek R1
102
  prompt = f"""The following is a medical AI's answer to a visual question.
103
  Keep the answer precise but structured, and helpful for a medical professional. Focus on abnormality.
 
98
  clean_up_tokenization_spaces=False
99
  )[0]
100
 
101
+
102
+ MAX_INPUT_CHARS = 2000
103
+ if len(output_text) > MAX_INPUT_CHARS:
104
+ output_text = output_text[:MAX_INPUT_CHARS] + "... [truncated]"
105
+
106
+
107
  # Send MedVLM output to DeepSeek R1
108
  prompt = f"""The following is a medical AI's answer to a visual question.
109
  Keep the answer precise but structured, and helpful for a medical professional. Focus on abnormality.