Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,9 @@
|
|
| 1 |
import os
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
from fastapi import FastAPI, Query
|
| 5 |
from fastapi.responses import FileResponse
|
|
|
|
| 1 |
import os
|
| 2 |
+
# 2️⃣ Optional: force cache to writable directory
|
| 3 |
+
os.environ["HF_HOME"] = "/tmp/hf"
|
| 4 |
+
os.environ["TRANSFORMERS_CACHE"] = "/tmp/hf"
|
| 5 |
+
os.environ["HF_DATASETS_CACHE"] = "/tmp/hf"
|
| 6 |
+
os.makedirs("/tmp/hf", exist_ok=True)
|
| 7 |
|
| 8 |
from fastapi import FastAPI, Query
|
| 9 |
from fastapi.responses import FileResponse
|