AxionLabsAI commited on
Commit
a8d4641
Β·
1 Parent(s): 784922d

Run Lumen API on CPU Space runtime

Browse files
Files changed (1) hide show
  1. app.py +1 -10
app.py CHANGED
@@ -7,7 +7,6 @@ import threading
7
  import queue as queue_mod
8
  import uvicorn
9
  import gradio as gr
10
- import spaces
11
  from fastapi import FastAPI, Request
12
  from fastapi.responses import StreamingResponse, JSONResponse
13
  from huggingface_hub import hf_hub_download
@@ -128,12 +127,6 @@ def _load_model():
128
  threading.Thread(target=_load_model, daemon=True).start()
129
 
130
 
131
- # ZeroGPU requires one decorated function even though inference stays on CPU.
132
- @spaces.GPU
133
- def _zerogpu_compatibility_marker():
134
- return True
135
-
136
-
137
  # ── Gradio chat helpers ───────────────────────────────────────────────────────
138
 
139
  def user_submit(message, history):
@@ -468,7 +461,5 @@ if __name__ == "__main__":
468
  uvicorn.run(
469
  app,
470
  host="0.0.0.0",
471
- # ZeroGPU's compatibility runtime reserves 7860. Gradio previously
472
- # selected 7861 automatically for this Space.
473
- port=7861,
474
  )
 
7
  import queue as queue_mod
8
  import uvicorn
9
  import gradio as gr
 
10
  from fastapi import FastAPI, Request
11
  from fastapi.responses import StreamingResponse, JSONResponse
12
  from huggingface_hub import hf_hub_download
 
127
  threading.Thread(target=_load_model, daemon=True).start()
128
 
129
 
 
 
 
 
 
 
130
  # ── Gradio chat helpers ───────────────────────────────────────────────────────
131
 
132
  def user_submit(message, history):
 
461
  uvicorn.run(
462
  app,
463
  host="0.0.0.0",
464
+ port=int(os.environ.get("PORT", "7860")),
 
 
465
  )