yasserrmd commited on
Commit
2c31a70
1 Parent(s): 146193f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -34,7 +34,7 @@ def extract_assistant_reply(input_string):
34
 
35
 
36
  @spaces.GPU
37
- def diagnose_router(image):
38
  messages = [
39
  {"role": "user", "content": [
40
  {"type": "image"},
@@ -45,7 +45,7 @@ def diagnose_router(image):
45
  inputs = processor(image, input_text, return_tensors="pt").to(model.device)
46
 
47
  # Generate the output from the model
48
- output = model.generate(**inputs, max_new_tokens=300)
49
  print(output)
50
  markdown_text = processor.decode(output[0])
51
  print(markdown_text)
@@ -56,11 +56,11 @@ def diagnose_router(image):
56
 
57
  # Gradio UI
58
  interface = gr.Interface(
59
- fn=diagnose_router,
60
- inputs=gr.Image(type="pil", label="Upload an image of the faulty router"),
61
  outputs=gr.HTML(),
62
- title="Router Diagnosis",
63
- description="Upload a photo of your router to receive a professional diagnosis and troubleshooting steps displayed in a structured, easy-to-read format."
64
  )
65
 
66
  # Launch the UI
 
34
 
35
 
36
  @spaces.GPU
37
+ def med_interpreter(image):
38
  messages = [
39
  {"role": "user", "content": [
40
  {"type": "image"},
 
45
  inputs = processor(image, input_text, return_tensors="pt").to(model.device)
46
 
47
  # Generate the output from the model
48
+ output = model.generate(**inputs, max_new_tokens=4000)
49
  print(output)
50
  markdown_text = processor.decode(output[0])
51
  print(markdown_text)
 
56
 
57
  # Gradio UI
58
  interface = gr.Interface(
59
+ fn=med_interpreter,
60
+ inputs=gr.Image(type="pil", label="Upload an image of the medical report"),
61
  outputs=gr.HTML(),
62
+ title="Medical Report Insights",
63
+ description="Upload an image of your medical report to get the interperation of it"
64
  )
65
 
66
  # Launch the UI