livetranslator / SPACE_README.md
mohrashid's picture
Upload 49 files
42d1288 verified

Live Translation App

This Space serves both the frontend (React + Vite build) and backend (FastAPI) from a single Docker container.

How to use

  • Open the Space URL. The UI loads from / and the API is same-origin.
  • Host view:
    • Start Recording for sentence-level live transcription
    • Upload audio for server-side transcription (use the Language hint for accuracy)
    • Click "Preload Model" to warm the translator

Endpoints

  • GET /health β†’ { "status": "ok" }
  • POST /translate β†’ { text, source_language, target_language }
  • POST /preload β†’ { source_language, target_language }
  • GET /metrics β†’ Prometheus metrics

Space variables (recommended)

  • STT_ENABLED=1 – enable server-side transcription
  • WHISPER_MODEL=small – good for CPU (use medium for better accuracy; large-v3 requires GPU)
  • Optional: REQUESTS_PER_MINUTE=60, ALLOWED_ORIGINS=*

Notes

  • First requests may download models. Use Preload to warm up.
  • For best accuracy on fast or unclear audio, set WHISPER_MODEL=medium (CPU) or upgrade to a GPU Space and use large-v3.