Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -7,8 +7,9 @@ from langdetect import detect, DetectorFactory
|
|
7 |
# Ensure consistent language detection results
|
8 |
DetectorFactory.seed = 0
|
9 |
|
10 |
-
# Set
|
11 |
-
os.environ["HF_HOME"] = "/
|
|
|
12 |
|
13 |
app = FastAPI()
|
14 |
|
|
|
7 |
# Ensure consistent language detection results
|
8 |
DetectorFactory.seed = 0
|
9 |
|
10 |
+
# Set Hugging Face cache directory to a writable location
|
11 |
+
os.environ["HF_HOME"] = "/tmp/huggingface"
|
12 |
+
os.makedirs(os.environ["HF_HOME"], exist_ok=True) # Ensure the directory exists
|
13 |
|
14 |
app = FastAPI()
|
15 |
|