Abdelkader HASSINE commited on
Commit
4fe5dcd
·
1 Parent(s): ff03012

Deploy CU1-X to Hugging Face Spaces

Browse files

- Multi-model AI pipeline (RF-DETR, CLIP, OCR, BLIP)
- Unified API architecture
- Gradio web interface
- Full model weights included via Git LFS
- Ready for production deployment

Files changed (2) hide show
  1. app.py +1 -2
  2. ui/shared_interface.py +3 -1
app.py CHANGED
@@ -146,8 +146,7 @@ def main():
146
  demo.queue().launch(
147
  server_name=UI_HOST,
148
  server_port=UI_PORT,
149
- share=False,
150
- api_name="predict" # Explicitly expose API endpoint
151
  )
152
  except OSError as e:
153
  if "Cannot find empty port" in str(e):
 
146
  demo.queue().launch(
147
  server_name=UI_HOST,
148
  server_port=UI_PORT,
149
+ share=False
 
150
  )
151
  except OSError as e:
152
  if "Cannot find empty port" in str(e):
ui/shared_interface.py CHANGED
@@ -260,6 +260,7 @@ def create_interface(
260
  )
261
 
262
  # Connect detection button
 
263
  detect_button.click(
264
  fn=detection_fn,
265
  inputs=[
@@ -275,7 +276,8 @@ def create_interface(
275
  preprocess_mode_radio,
276
  preprocess_preset_dropdown
277
  ],
278
- outputs=[output_image, summary_output, json_output]
 
279
  )
280
 
281
  # Build footer markdown
 
260
  )
261
 
262
  # Connect detection button
263
+ # api_name exposes this function as /api/predict endpoint for Hugging Face Spaces
264
  detect_button.click(
265
  fn=detection_fn,
266
  inputs=[
 
276
  preprocess_mode_radio,
277
  preprocess_preset_dropdown
278
  ],
279
+ outputs=[output_image, summary_output, json_output],
280
+ api_name="predict" # Expose as /api/predict endpoint
281
  )
282
 
283
  # Build footer markdown