Spaces:
Sleeping
Sleeping
p2002814
commited on
Commit
·
e68ee99
1
Parent(s):
bb34072
fixed hugging face cache problem
Browse files
app.py
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI, UploadFile, File, Form
|
| 2 |
from fastapi.responses import FileResponse
|
| 3 |
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
cache_dir = "/tmp/hf_cache"
|
| 4 |
+
os.environ["TRANSFORMERS_CACHE"] = cache_dir
|
| 5 |
+
os.makedirs(cache_dir, exist_ok=True)
|
| 6 |
+
|
| 7 |
from fastapi import FastAPI, UploadFile, File, Form
|
| 8 |
from fastapi.responses import FileResponse
|
| 9 |
from fastapi.middleware.cors import CORSMiddleware
|