Spaces:
Running on Zero
Running on Zero
Commit History
-
Drive the MT model directly: transformers 5 dropped the translation task Running
pipeline('translation') raises KeyError on transformers 5, and gradio 6's huggingface-hub 1.x requirement rules out going back to 4.x. Use AutoModelForSeq2SeqLM with beam search instead - deterministic, which is the point of moving off Gemini.aaf92dc -
Fall back to CPU when the GPU path fails, and surface tracebacks
/translate 500d in 5s with mt.error still null, so the failure was in the ZeroGPU call rather than model loading. Try the decorated function, then retry the same work on CPU instead of failing the request. Reading Space logs needs a token, so unhandled errors now come back in the response body.80a7b2e -
Declare @spaces.GPU functions so ZeroGPU will start the Space
ZeroGPU refuses to start a Space with no decorated function - 'No @spaces.GPU function detected during startup' - which is why hardware.current stayed None from the first build. Move the model calls into decorated functions, since that is the only window in which a device is actually attached, and default to cuda when the spaces package is importable.868e5b5 -
Disable SSR and hold the process open
Gradio 6 defaults to SSR, which fronts the public port with a Node proxy and serves Python on 7861 behind it — routes grafted onto the Python app were unreachable from outside. block_thread() also returned straight away and the container exited, so wait explicitly.4bb4d57 -
Let Gradio bind the port and graft the REST routes onto it
Our own uvicorn raced the runner for 7860; a bare ASGI app with no listener left nothing serving. Gradio launches instead, and /asr, /translate and /health are prepended to its router so its frontend catch-all cannot shadow them. Health moves off / because Gradio owns / for the UI.85d2c5b
-
Do not bind a port; let the Space runner serve the ASGI app
The runner already serves the module-level app, so our own uvicorn.run was a second server competing for 7860 — the container died on 'address already in use' right after startup completed. Mount the Blocks UI onto the same app at import time instead, keeping /asr and /translate at the root.74d52f2 -
Require transformers 5.x to match the builder's hub 1.x
transformers 4.x caps huggingface-hub below 1.0; gradio 6 and spaces both need 1.x, so pip had no solution and the build failed. Also switch to a string device and tolerate ffmpeg_read having moved in v5.7cb4735 -
Let the Space builder own torch/gradio/spaces
The builder already installs torch (pinned <=2.11.0), gradio, uvicorn and spaces. Pinning a CPU-only torch from a custom index here collided with that pin and failed the build outright.f8c62dc -
Serve NCAIR1/Hausa-ASR + opus-mt-ha-en over REST
Gradio SDK, but the REST routes are the interface: the Blocks UI is mounted onto our own FastAPI so /asr and /translate stay at the root, where the ScriptFlow backend already expects them. /asr returns word-level timings in the shape Chirp 3 produced, so the backend's existing cue splitter consumes the output unchanged.9795cbf -
initial commit
Verified signatureb3e0e3c