Spaces:
Sleeping
Sleeping
Commit
Β·
05fd8f1
1
Parent(s):
1e0d7f9
Switch to Whisper medium model with lazy loading
Browse files- Dockerfile +5 -5
- app/config.py +1 -1
Dockerfile
CHANGED
|
@@ -35,11 +35,11 @@ RUN python -c "from transformers import AutoTokenizer, AutoModelForSequenceClass
|
|
| 35 |
AutoModelForSequenceClassification.from_pretrained('Cyberlace/swara-structure-model', cache_dir='/.cache'); \
|
| 36 |
print('β
Structure Model cached!')"
|
| 37 |
|
| 38 |
-
# 2.
|
| 39 |
-
RUN python -c "import whisper; \
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
|
| 44 |
# 3. Download Sentence Transformer for Keywords (~420MB)
|
| 45 |
RUN python -c "from sentence_transformers import SentenceTransformer; \
|
|
|
|
| 35 |
AutoModelForSequenceClassification.from_pretrained('Cyberlace/swara-structure-model', cache_dir='/.cache'); \
|
| 36 |
print('β
Structure Model cached!')"
|
| 37 |
|
| 38 |
+
# 2. Whisper will be downloaded on first use (lazy loading to avoid OOM during build)
|
| 39 |
+
# RUN python -c "import whisper; \
|
| 40 |
+
# print('π₯ Downloading Whisper medium model...'); \
|
| 41 |
+
# whisper.load_model('medium', download_root='/.cache'); \
|
| 42 |
+
# print('β
Whisper medium cached!')"
|
| 43 |
|
| 44 |
# 3. Download Sentence Transformer for Keywords (~420MB)
|
| 45 |
RUN python -c "from sentence_transformers import SentenceTransformer; \
|
app/config.py
CHANGED
|
@@ -31,7 +31,7 @@ class Settings(BaseSettings):
|
|
| 31 |
UPLOAD_DIR: str = os.getenv("UPLOAD_DIR", "./uploads")
|
| 32 |
|
| 33 |
# Model Configuration
|
| 34 |
-
WHISPER_MODEL: str = os.getenv("WHISPER_MODEL", "
|
| 35 |
KATA_KUNCI_PATH: str = os.getenv("KATA_KUNCI_PATH", "./kata_kunci.json")
|
| 36 |
|
| 37 |
# Device Configuration (CPU/GPU)
|
|
|
|
| 31 |
UPLOAD_DIR: str = os.getenv("UPLOAD_DIR", "./uploads")
|
| 32 |
|
| 33 |
# Model Configuration
|
| 34 |
+
WHISPER_MODEL: str = os.getenv("WHISPER_MODEL", "medium") # Changed to medium for better accuracy
|
| 35 |
KATA_KUNCI_PATH: str = os.getenv("KATA_KUNCI_PATH", "./kata_kunci.json")
|
| 36 |
|
| 37 |
# Device Configuration (CPU/GPU)
|