Spaces:
Sleeping
Sleeping
thadillo
Claude
commited on
Commit
·
0a4e3e9
1
Parent(s):
434e8da
Fix: Add protobuf dependency for DeBERTa models
Browse files- Added protobuf>=3.20.0 to requirements.txt
- Removed fine-tuning model pre-download (downloaded on-demand)
- Keep only zero-shot models in container (BART, DeBERTa, DistilBART)
- Added progress messages during model downloads
This fixes the ImportError for DeBERTa tokenizers
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
- Dockerfile +7 -7
- requirements.txt +1 -0
Dockerfile
CHANGED
|
@@ -33,16 +33,16 @@ RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
|
|
| 33 |
ENV HF_HOME=/app/.cache/huggingface
|
| 34 |
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
|
| 35 |
|
| 36 |
-
# Download zero-shot models (for analysis)
|
|
|
|
| 37 |
RUN python -c "from transformers import pipeline; \
|
|
|
|
| 38 |
pipeline('zero-shot-classification', model='facebook/bart-large-mnli', device=-1); \
|
|
|
|
| 39 |
pipeline('zero-shot-classification', model='MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli', device=-1); \
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
RUN python -c "from transformers import AutoModelForSequenceClassification, AutoTokenizer; \
|
| 44 |
-
AutoTokenizer.from_pretrained('microsoft/deberta-v3-small'); \
|
| 45 |
-
AutoTokenizer.from_pretrained('microsoft/deberta-v3-base')"
|
| 46 |
|
| 47 |
# Hugging Face Spaces uses port 7860
|
| 48 |
EXPOSE 7860
|
|
|
|
| 33 |
ENV HF_HOME=/app/.cache/huggingface
|
| 34 |
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
|
| 35 |
|
| 36 |
+
# Download zero-shot models (for immediate analysis capability)
|
| 37 |
+
# These are loaded on first analysis, pre-downloading saves time and /data space
|
| 38 |
RUN python -c "from transformers import pipeline; \
|
| 39 |
+
print('Downloading BART-large-MNLI...'); \
|
| 40 |
pipeline('zero-shot-classification', model='facebook/bart-large-mnli', device=-1); \
|
| 41 |
+
print('Downloading DeBERTa-v3-base-MNLI...'); \
|
| 42 |
pipeline('zero-shot-classification', model='MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli', device=-1); \
|
| 43 |
+
print('Downloading DistilBART-MNLI...'); \
|
| 44 |
+
pipeline('zero-shot-classification', model='valhalla/distilbart-mnli-12-3', device=-1); \
|
| 45 |
+
print('All models downloaded successfully')"
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
# Hugging Face Spaces uses port 7860
|
| 48 |
EXPOSE 7860
|
requirements.txt
CHANGED
|
@@ -6,6 +6,7 @@ torch==2.5.0
|
|
| 6 |
sentencepiece>=0.2.0
|
| 7 |
gunicorn==21.2.0
|
| 8 |
hf-transfer>=0.1.5
|
|
|
|
| 9 |
|
| 10 |
# Fine-tuning dependencies
|
| 11 |
peft==0.13.2
|
|
|
|
| 6 |
sentencepiece>=0.2.0
|
| 7 |
gunicorn==21.2.0
|
| 8 |
hf-transfer>=0.1.5
|
| 9 |
+
protobuf>=3.20.0
|
| 10 |
|
| 11 |
# Fine-tuning dependencies
|
| 12 |
peft==0.13.2
|