PRANAV05092003 commited on
Commit
f22517f
·
1 Parent(s): b870822

Final Commit

Browse files
Files changed (1) hide show
  1. server.py +7 -17
server.py CHANGED
@@ -468,25 +468,15 @@ def _demo_html() -> str:
468
  # Routes
469
  # ---------------------------------------------------------------------------
470
 
471
- @app.get("/")
472
- def root() -> JSONResponse:
473
  """
474
- Live demo root endpoint.
475
 
476
- Hugging Face Spaces typically render the response from `/` in the preview.
477
- We run a deterministic demo episode over all tasks and return the results.
478
  """
479
- from inference import run_all_tasks
480
-
481
- results = run_all_tasks()
482
- payload = {
483
- "status": "ok",
484
- "env": "ACRE",
485
- "version": "1.0.0",
486
- "message": "ACRE running successfully",
487
- "results": results,
488
- }
489
- return JSONResponse(content=payload)
490
 
491
 
492
  @app.get("/health", response_model=CompatibilityHealthResponse)
@@ -505,7 +495,7 @@ def demo() -> JSONResponse:
505
 
506
  @app.get("/ui", response_class=HTMLResponse)
507
  def demo_ui() -> HTMLResponse:
508
- """Simple UI to compare original and optimized code side-by-side."""
509
  return HTMLResponse(content=_demo_html())
510
 
511
 
 
468
  # Routes
469
  # ---------------------------------------------------------------------------
470
 
471
+ @app.get("/", response_class=HTMLResponse)
472
+ def root() -> HTMLResponse:
473
  """
474
+ Hugging Face Space homepage.
475
 
476
+ Serve the interactive UI so opening the Space shows a real demo page.
477
+ The live JSON execution results remain available at `GET /demo`.
478
  """
479
+ return HTMLResponse(content=_demo_html())
 
 
 
 
 
 
 
 
 
 
480
 
481
 
482
  @app.get("/health", response_model=CompatibilityHealthResponse)
 
495
 
496
  @app.get("/ui", response_class=HTMLResponse)
497
  def demo_ui() -> HTMLResponse:
498
+ """Alias for the interactive UI (same as `/`)."""
499
  return HTMLResponse(content=_demo_html())
500
 
501