How sabtain-dev/stt-whisper-pashto works
This repository delivers Pakistani Pashto speech recognition through a Streamlit dashboard and a versioned FastAPI transcription service. The documented API path is upload, validation, temporary staging, Whisper inference and a structured response; inference preprocesses audio and loads the fine-tuned model. The README also describes dashboard editing, translation, WER evaluation and authentication, but app internals were not excerpted, so those capabilities are shown without guessed call links. Edges reflect excerpts or README statements; unsampled internals are not inferred.
Main entry points: app.py Streamlit dashboard · transcription.py Transcription endpoints · main.py FastAPI application · transcription_service.py Transcription service
Components 21
User dashboard
- Streamlit dashboard
app/app.py - Text editing
app/app.py - Translation
app/app.py - WER evaluation
app/app.py - User authentication
app/app.py - API client
app/app.py
REST service
- FastAPI application
api/main.py - Runtime settings
api/config.py - Exception handling
api/exceptions.py - Transcription endpoints
api/routes/transcription.py - Upload validation
api/utils/validation.py - Response schemas
api/schemas/response.py - Transcription service
api/services/transcription_service.py - Shared engine cache
api/dependencies.py - Temporary audio files
api/services/transcription_service.py
Speech inference
- Pashto transcriber
utils/inference.py - Audio preprocessing
utils/audio_utils.py - Whisper model loading
utils/model_utils.py
Other components
- End user
- Hugging Face model
- Audio upload
Connections 23
- End user → Streamlit dashboard: uses
README.md - Streamlit dashboard → Text editing: supports editing
README.md - Streamlit dashboard → Translation: supports translation
README.md - Streamlit dashboard → WER evaluation: supports evaluation
README.md - Streamlit dashboard → User authentication: supports authentication
README.md - Streamlit dashboard → API client: sends requests
README.md - API client → FastAPI application: HTTP requests
README.md - FastAPI application → Transcription endpoints: registers router
api/main.py - FastAPI application → Runtime settings: configures routes
api/main.py - FastAPI application → Exception handling: registers handlers
api/main.py - Audio upload → Transcription endpoints: posts audio
api/routes/transcription.py - Transcription endpoints → Upload validation: validates upload
api/routes/transcription.py - Transcription endpoints → Shared engine cache: gets engine
api/routes/transcription.py - Transcription endpoints → Transcription service: calls service
api/routes/transcription.py - Transcription endpoints → Response schemas: returns schema
api/routes/transcription.py - Transcription service → Runtime settings: checks formats
api/services/transcription_service.py - Transcription service → Temporary audio files: stages and removes
api/services/transcription_service.py - Transcription service → Shared engine cache: calls engine
- Shared engine cache → Pashto transcriber: constructs engine
api/dependencies.py - Pashto transcriber → Audio preprocessing: preprocesses audio
utils/inference.py - Pashto transcriber → Whisper model loading: loads components
utils/inference.py - Whisper model loading → Hugging Face model: loads checkpoint
utils/model_utils.py - Pashto transcriber → Whisper model loading: uses model and processor
utils/inference.py