Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +7 -2
Dockerfile
CHANGED
@@ -4,8 +4,13 @@ COPY requirements.txt .
|
|
4 |
RUN apt update && apt install -y curl git && rm -rf /var/lib/apt/lists/*
|
5 |
RUN pip install --no-cache-dir -r requirements.txt
|
6 |
RUN mkdir -p /app/logs && chmod -R 777 /app/logs
|
7 |
-
RUN python -c "from transformers import AutoModelForSeq2SeqLM;
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
9 |
COPY . .
|
10 |
EXPOSE 7860
|
11 |
CMD ["python", "app.py"]
|
|
|
4 |
RUN apt update && apt install -y curl git && rm -rf /var/lib/apt/lists/*
|
5 |
RUN pip install --no-cache-dir -r requirements.txt
|
6 |
RUN mkdir -p /app/logs && chmod -R 777 /app/logs
|
7 |
+
RUN python -c "from transformers import AutoModelForSeq2SeqLM, AutoTokenizer; \
|
8 |
+
model = AutoModelForSeq2SeqLM.from_pretrained('facebook/bart-large-cnn'); \
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained('facebook/bart-large-cnn'); \
|
10 |
+
model.save_pretrained('/app/models/bart-large-cnn'); \
|
11 |
+
tokenizer.save_pretrained('/app/models/bart-large-cnn')"
|
12 |
+
RUN python -c "from sentence_transformers import SentenceTransformer; \
|
13 |
+
SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2').save('/app/models/all-MiniLM-L6-v2')"
|
14 |
COPY . .
|
15 |
EXPOSE 7860
|
16 |
CMD ["python", "app.py"]
|