Spaces:
Runtime error
Runtime error
Updated Dockerfile for Hugging Face Spaces deployment
Browse files- Dockerfile +4 -0
- models/nllb.py +3 -0
Dockerfile
CHANGED
|
@@ -52,6 +52,10 @@ RUN chmod -R 777 /app/cache/huggingface
|
|
| 52 |
ENV HF_HOME=/app/cache/huggingface
|
| 53 |
ENV TRANSFORMERS_CACHE=/app/cache/huggingface
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
# Copy the setup script and requirements file into the container
|
| 56 |
COPY setup.sh requirements.txt /app/
|
| 57 |
|
|
|
|
| 52 |
ENV HF_HOME=/app/cache/huggingface
|
| 53 |
ENV TRANSFORMERS_CACHE=/app/cache/huggingface
|
| 54 |
|
| 55 |
+
# Disable numba caching
|
| 56 |
+
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
|
| 57 |
+
ENV NUMBA_DISABLE_JIT=1
|
| 58 |
+
|
| 59 |
# Copy the setup script and requirements file into the container
|
| 60 |
COPY setup.sh requirements.txt /app/
|
| 61 |
|
models/nllb.py
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
| 2 |
import torch
|
| 3 |
import os
|
|
|
|
|
|
|
|
|
|
| 4 |
def nllb():
|
| 5 |
"""
|
| 6 |
Load and return the NLLB (No Language Left Behind) model and tokenizer.
|
|
|
|
| 1 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
| 2 |
import torch
|
| 3 |
import os
|
| 4 |
+
# Disable numba caching
|
| 5 |
+
os.environ["NUMBA_CACHE_DIR"] = "/tmp/numba_cache"
|
| 6 |
+
os.environ["NUMBA_DISABLE_JIT"] = "1"
|
| 7 |
def nllb():
|
| 8 |
"""
|
| 9 |
Load and return the NLLB (No Language Left Behind) model and tokenizer.
|