Spaces:
Runtime error
Runtime error
111306047 commited on
Commit ·
3a052d8
1
Parent(s): fe4a64d
fix cache with tmp
Browse files
app.py
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
import os
|
| 2 |
-
|
| 3 |
-
os.
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
import torch
|
| 6 |
from fastapi import FastAPI
|
|
|
|
| 1 |
import os
|
| 2 |
+
CACHE_DIR = "/tmp/hf_cache"
|
| 3 |
+
os.environ["HF_HOME"] = CACHE_DIR
|
| 4 |
+
os.environ["TRANSFORMERS_CACHE"] = CACHE_DIR
|
| 5 |
+
os.environ["HUGGINGFACE_HUB_CACHE"] = CACHE_DIR
|
| 6 |
+
os.makedirs(CACHE_DIR, exist_ok=True)
|
| 7 |
|
| 8 |
import torch
|
| 9 |
from fastapi import FastAPI
|