Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import os
|
2 |
|
3 |
-
# Imposta la cache dei modelli in una cartella scrivibile
|
4 |
-
os.environ["
|
5 |
|
6 |
from fastapi import FastAPI, Request
|
7 |
from fastapi.responses import JSONResponse, FileResponse
|
@@ -11,7 +11,7 @@ import uvicorn
|
|
11 |
app = FastAPI()
|
12 |
|
13 |
# Crea la cartella di cache se non esiste
|
14 |
-
os.makedirs("/
|
15 |
|
16 |
# Carica il modello Hugging Face
|
17 |
model_name = "microsoft/DialoGPT-small"
|
|
|
1 |
import os
|
2 |
|
3 |
+
# Imposta la cache dei modelli in una cartella scrivibile all'interno della home dell'utente
|
4 |
+
os.environ["HF_HOME"] = "/tmp/huggingface"
|
5 |
|
6 |
from fastapi import FastAPI, Request
|
7 |
from fastapi.responses import JSONResponse, FileResponse
|
|
|
11 |
app = FastAPI()
|
12 |
|
13 |
# Crea la cartella di cache se non esiste
|
14 |
+
os.makedirs("/tmp/huggingface", exist_ok=True)
|
15 |
|
16 |
# Carica il modello Hugging Face
|
17 |
model_name = "microsoft/DialoGPT-small"
|