How dimkablin/speech2text_factory works
Main Components
a) Client Layer:
• Web Interface (from docs/index.html)
• External API Consumers
b) API Layer (FastAPI):
• Main API Gateway (src/api/main.py)
• Endpoints Controller (src/api/app/endpoint.py)
• CRUD Operations (src/api/app/crud.py)
• Middleware (src/api/app/middleware.py)
• Data Models (src/api/app/models.py)
c) Core Processing Layer:
• Speech-to-Text Factory (src/ai_models/speech2text.py)
• Model Interface (src/ai_models/speech2text_interface.py)
• Multiple STT Model Implementations:
• Whisper Model (src/ai_models/whisper/model.py)
• Custom STT Model (src/ai_models/stt/model.py)
d) Utility Layer:
• Feature Extraction (src/utils/features_extractor.py)
• Buffer Management (src/ai_models/stt/buffer)
[Client Layer]
• ↓
[API Layer]
• ↓
[Core Processing Layer]
• ↓
[Utility Layer]
Key Relationships
• Factory pattern relationship between speech2text.py and the different model implementations
• Data flow from audio input through feature extraction to model processing
• Relationship between the buffer system and model processing
Specific Elements
a) API Endpoints (as listed in README):
• GET / (Homepage)
• GET /get-model-names/
• GET /get-current-model/
• POST /speech-to-text/
• GET /get-model-config/
• POST /change-model/
b) Model Factory System:
• How speech2text.py acts as a factory for different model implementations
• Interface pattern using speech2text_interface.py
c) Data Flow:
• Audio input (.mp3, .wav)
• Feature extraction process
• Model processing
• Text output
Technical Stack Indicators
• Python 3.10
• FastAPI
• PyTorch
• CUDA
• Docker