re-type commited on
Commit
cb1d704
·
verified ·
1 Parent(s): 040a8cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -7
app.py CHANGED
@@ -1050,13 +1050,24 @@ if __name__ == "__main__":
1050
 
1051
  print("\n🚀 Starting Gradio interface...")
1052
 
1053
- # Create and launch interface
1054
- iface = create_interface()
1055
- iface.launch(
1056
- share=False, # Set to True if you want to create a public link
1057
- server_name="0.0.0.0", # Allow connections from any IP
1058
- server_port=7860, # Default Gradio port
1059
- show_error=True # Show errors in the interface
 
 
 
 
 
 
 
 
 
 
 
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: