Aashi commited on
Commit
e7a20c4
·
1 Parent(s): e7cde15

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ def generate_prescription(image):
3
+ response = model.generate_content(["Write a prescription in pointer format ordered by name of medicine, symptoms, primary diagnosis, usage and dosage of medicine in the image. Make sure to ask person to visit doctor if problem presists.", image])
4
+ return response.text
5
+
6
+ interface = gr.Interface(fn=generate_prescription,
7
+ inputs=gr.Image(label="Upload image", type="pil"),
8
+ outputs=gr.Textbox(label="Your prescription is here:"),
9
+ title="Medicine Prescription",
10
+ description="Find Prescription to any medicine",
11
+ allow_flagging="never",
12
+ examples=["/content/med1.jpg", "/content/med2.jpg"])
13
+ interface.launch(debug = True)