Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ donut_model = VisionEncoderDecoderModel.from_pretrained("chinmays18/medical-pres
|
|
| 18 |
reader = easyocr.Reader(['en'])
|
| 19 |
humadex_pipe = pipeline("token-classification", model="HUMADEX/english_medical_ner", aggregation_strategy="simple")
|
| 20 |
medner_pipe = pipeline("token-classification", model="blaze999/Medical-NER", aggregation_strategy="simple")
|
| 21 |
-
biogpt_pipe = pipeline("text-generation", model="
|
| 22 |
|
| 23 |
def advanced_preprocess(image_path):
|
| 24 |
img = Image.open(image_path).convert('L')
|
|
@@ -96,7 +96,7 @@ async def prescription(file: UploadFile = File(...)):
|
|
| 96 |
@app.post("/api/chat")
|
| 97 |
async def chat(message: str = Form(...)):
|
| 98 |
# Query BioGPT
|
| 99 |
-
result = biogpt_pipe(message, max_new_tokens=
|
| 100 |
return {"response": result}
|
| 101 |
|
| 102 |
# Optionally, add D-ID . . .
|
|
|
|
| 18 |
reader = easyocr.Reader(['en'])
|
| 19 |
humadex_pipe = pipeline("token-classification", model="HUMADEX/english_medical_ner", aggregation_strategy="simple")
|
| 20 |
medner_pipe = pipeline("token-classification", model="blaze999/Medical-NER", aggregation_strategy="simple")
|
| 21 |
+
biogpt_pipe = pipeline("text-generation", model="Vijayendra/Phi4-MedQA")
|
| 22 |
|
| 23 |
def advanced_preprocess(image_path):
|
| 24 |
img = Image.open(image_path).convert('L')
|
|
|
|
| 96 |
@app.post("/api/chat")
|
| 97 |
async def chat(message: str = Form(...)):
|
| 98 |
# Query BioGPT
|
| 99 |
+
result = biogpt_pipe(message, max_new_tokens=400)[0]["generated_text"]
|
| 100 |
return {"response": result}
|
| 101 |
|
| 102 |
# Optionally, add D-ID . . .
|