Spaces:
Sleeping
Sleeping
Thiagoc.machado commited on
Commit ·
0988e73
1
Parent(s): 5d60ce6
Subindo API Docker com modelo de embeddings
Browse files- Dockerfile +2 -0
- app.py +3 -0
Dockerfile
CHANGED
|
@@ -11,6 +11,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 11 |
COPY requirements.txt .
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
|
|
|
|
|
|
| 14 |
# Copia os arquivos da app
|
| 15 |
COPY . .
|
| 16 |
|
|
|
|
| 11 |
COPY requirements.txt .
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
+
RUN mkdir -p /code/cache && chmod -R 777 /code/cache
|
| 15 |
+
|
| 16 |
# Copia os arquivos da app
|
| 17 |
COPY . .
|
| 18 |
|
app.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI, Request
|
| 2 |
from transformers import AutoTokenizer, AutoModel
|
| 3 |
import torch
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
os.environ['TRANSFORMERS_CACHE'] = '/code/cache'
|
| 3 |
+
|
| 4 |
from fastapi import FastAPI, Request
|
| 5 |
from transformers import AutoTokenizer, AutoModel
|
| 6 |
import torch
|