Spaces:
Runtime error
Runtime error
ignore temp files
Browse files
main.py
CHANGED
|
@@ -5,13 +5,13 @@ import aiohttp
|
|
| 5 |
from fastapi import FastAPI, File, UploadFile, HTTPException
|
| 6 |
from fastapi.responses import JSONResponse
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
# cache_path = path.join(path.dirname(path.abspath(__file__)), "models")
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
|
| 16 |
# PATH = 'huggingface'
|
| 17 |
# DATASETPATH = '/home/ahmadzen/.cache/huggingface/datasets'
|
|
|
|
| 5 |
from fastapi import FastAPI, File, UploadFile, HTTPException
|
| 6 |
from fastapi.responses import JSONResponse
|
| 7 |
|
| 8 |
+
import os
|
| 9 |
+
from os import path
|
| 10 |
# cache_path = path.join(path.dirname(path.abspath(__file__)), "models")
|
| 11 |
+
cache_path = "~/hf_home"
|
| 12 |
+
os.environ["TRANSFORMERS_CACHE"] = cache_path
|
| 13 |
+
os.environ["HF_HUB_CACHE"] = cache_path
|
| 14 |
+
os.environ["HF_HOME"] = cache_path
|
| 15 |
|
| 16 |
# PATH = 'huggingface'
|
| 17 |
# DATASETPATH = '/home/ahmadzen/.cache/huggingface/datasets'
|