Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -235,11 +235,11 @@ with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
|
|
| 235 |
with gr.Accordion("Note", open=False):
|
| 236 |
gr.Markdown("Inference using Huggingface transformers on NVIDIA GPUs. This app is running with transformers version 4.57.1 and torch version 2.6.0.")
|
| 237 |
|
| 238 |
-
def toggle_ref_text_visibility(task):
|
| 239 |
-
return gr.Textbox(visible=True) if task == "Locate Object by Reference" else gr.Textbox(visible=False)
|
| 240 |
|
| 241 |
task_type.change(fn=toggle_ref_text_visibility, inputs=task_type, outputs=ref_text_input)
|
| 242 |
submit_btn.click(fn=process_ocr_task, inputs=[image_input, model_size, task_type, ref_text_input], outputs=[output_text, output_image])
|
| 243 |
|
| 244 |
if __name__ == "__main__":
|
| 245 |
-
demo.queue(max_size=20).launch(
|
|
|
|
| 235 |
with gr.Accordion("Note", open=False):
|
| 236 |
gr.Markdown("Inference using Huggingface transformers on NVIDIA GPUs. This app is running with transformers version 4.57.1 and torch version 2.6.0.")
|
| 237 |
|
| 238 |
+
# def toggle_ref_text_visibility(task):
|
| 239 |
+
# return gr.Textbox(visible=True) if task == "Locate Object by Reference" else gr.Textbox(visible=False)
|
| 240 |
|
| 241 |
task_type.change(fn=toggle_ref_text_visibility, inputs=task_type, outputs=ref_text_input)
|
| 242 |
submit_btn.click(fn=process_ocr_task, inputs=[image_input, model_size, task_type, ref_text_input], outputs=[output_text, output_image])
|
| 243 |
|
| 244 |
if __name__ == "__main__":
|
| 245 |
+
demo.queue(max_size=20).launch(mcp_server=True, ssr_mode=False)
|