Update app.py
Browse files
app.py
CHANGED
@@ -106,7 +106,7 @@ def process_image(api_key, image_input, unit):
|
|
106 |
response = model.generate_content([prompt, image_input],request_options={"timeout": 60})
|
107 |
return response.text
|
108 |
|
109 |
-
def main(api_key
|
110 |
SYS_PROMPT = read('system_prompt.txt')
|
111 |
if text_input and image_input is None:
|
112 |
return process_text(text_input,unit)
|
@@ -133,7 +133,7 @@ with gr.Blocks(theme='shivi/calm_seafoam', css=css, title="Medster - Medical Dia
|
|
133 |
clear_btn = gr.ClearButton(output_box, value="🗑️ Clear") # Create a clear button
|
134 |
|
135 |
# Set up the event listeners
|
136 |
-
submit_btn.click(main, inputs=[api_key, text_input, image_input
|
137 |
|
138 |
gr.Markdown(LICENSE)
|
139 |
|
|
|
106 |
response = model.generate_content([prompt, image_input],request_options={"timeout": 60})
|
107 |
return response.text
|
108 |
|
109 |
+
def main(api_key, text_input="", image_input=None, unit):
|
110 |
SYS_PROMPT = read('system_prompt.txt')
|
111 |
if text_input and image_input is None:
|
112 |
return process_text(text_input,unit)
|
|
|
133 |
clear_btn = gr.ClearButton(output_box, value="🗑️ Clear") # Create a clear button
|
134 |
|
135 |
# Set up the event listeners
|
136 |
+
submit_btn.click(main, inputs=[unit, api_key, text_input, image_input], outputs=output_box)
|
137 |
|
138 |
gr.Markdown(LICENSE)
|
139 |
|