Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
|
@@ -1050,13 +1050,24 @@ if __name__ == "__main__":
|
|
| 1050 |
|
| 1051 |
print("\n🚀 Starting Gradio interface...")
|
| 1052 |
|
| 1053 |
-
|
| 1054 |
-
|
| 1055 |
-
|
| 1056 |
-
|
| 1057 |
-
|
| 1058 |
-
|
| 1059 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1060 |
)
|
| 1061 |
|
| 1062 |
except Exception as e:
|
|
|
|
| 1050 |
|
| 1051 |
print("\n🚀 Starting Gradio interface...")
|
| 1052 |
|
| 1053 |
+
# Create and launch interface
|
| 1054 |
+
iface = create_interface()
|
| 1055 |
+
# Expose minimal API for programmatic use
|
| 1056 |
+
api_interface = gr.Interface(
|
| 1057 |
+
fn=run_pipeline,
|
| 1058 |
+
inputs=[gr.Textbox(), gr.Slider(), gr.Checkbox()],
|
| 1059 |
+
outputs=[gr.Textbox(), gr.Textbox(), gr.Textbox(), gr.Textbox(), gr.Textbox(), gr.File(), gr.File(), gr.File(), gr.HTML()]
|
| 1060 |
+
)
|
| 1061 |
+
|
| 1062 |
+
iface.launch(
|
| 1063 |
+
iface.launch(
|
| 1064 |
+
share=False,
|
| 1065 |
+
server_name="0.0.0.0",
|
| 1066 |
+
server_port=7860,
|
| 1067 |
+
show_error=True,
|
| 1068 |
+
api=True # ← This enables /run/predict
|
| 1069 |
+
)
|
| 1070 |
+
)
|
| 1071 |
)
|
| 1072 |
|
| 1073 |
except Exception as e:
|