Spaces:
Sleeping
Sleeping
Commit ·
dd0fe1f
1
Parent(s): 560aa8b
fix: make model caching non-blocking to bypass huggingface auth errors
Browse files- Dockerfile +2 -2
Dockerfile
CHANGED
|
@@ -47,7 +47,7 @@ RUN python -c "\
|
|
| 47 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM; \
|
| 48 |
AutoTokenizer.from_pretrained('ai4bharat/indictrans2-en-indic-dist-200M', trust_remote_code=True, cache_dir='/app/models/indictrans2/en_to_indic'); \
|
| 49 |
AutoModelForSeq2SeqLM.from_pretrained('ai4bharat/indictrans2-en-indic-dist-200M', trust_remote_code=True, cache_dir='/app/models/indictrans2/en_to_indic'); \
|
| 50 |
-
print('✓ IndicTrans2 English→Indic model cached')"
|
| 51 |
|
| 52 |
# ── Layer 5b: Pre-cache IndicTrans2 Indic→English model ──────
|
| 53 |
# This is the REVERSE direction model (Sprint 18).
|
|
@@ -57,7 +57,7 @@ RUN python -c "\
|
|
| 57 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM; \
|
| 58 |
AutoTokenizer.from_pretrained('ai4bharat/indictrans2-indic-en-dist-200M', trust_remote_code=True, cache_dir='/app/models/indictrans2/indic_to_en'); \
|
| 59 |
AutoModelForSeq2SeqLM.from_pretrained('ai4bharat/indictrans2-indic-en-dist-200M', trust_remote_code=True, cache_dir='/app/models/indictrans2/indic_to_en'); \
|
| 60 |
-
print('✓ IndicTrans2 Indic→English model cached')"
|
| 61 |
|
| 62 |
# ── Layer 6: Copy application code LAST ──────────────────────
|
| 63 |
# Code changes don't invalidate the expensive model cache layers.
|
|
|
|
| 47 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM; \
|
| 48 |
AutoTokenizer.from_pretrained('ai4bharat/indictrans2-en-indic-dist-200M', trust_remote_code=True, cache_dir='/app/models/indictrans2/en_to_indic'); \
|
| 49 |
AutoModelForSeq2SeqLM.from_pretrained('ai4bharat/indictrans2-en-indic-dist-200M', trust_remote_code=True, cache_dir='/app/models/indictrans2/en_to_indic'); \
|
| 50 |
+
print('✓ IndicTrans2 English→Indic model cached')" || echo "⚠️ IndicTrans2 en-indic cache failed (non-blocking)"
|
| 51 |
|
| 52 |
# ── Layer 5b: Pre-cache IndicTrans2 Indic→English model ──────
|
| 53 |
# This is the REVERSE direction model (Sprint 18).
|
|
|
|
| 57 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM; \
|
| 58 |
AutoTokenizer.from_pretrained('ai4bharat/indictrans2-indic-en-dist-200M', trust_remote_code=True, cache_dir='/app/models/indictrans2/indic_to_en'); \
|
| 59 |
AutoModelForSeq2SeqLM.from_pretrained('ai4bharat/indictrans2-indic-en-dist-200M', trust_remote_code=True, cache_dir='/app/models/indictrans2/indic_to_en'); \
|
| 60 |
+
print('✓ IndicTrans2 Indic→English model cached')" || echo "⚠️ IndicTrans2 indic-en cache failed (non-blocking)"
|
| 61 |
|
| 62 |
# ── Layer 6: Copy application code LAST ──────────────────────
|
| 63 |
# Code changes don't invalidate the expensive model cache layers.
|