Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -9,6 +9,12 @@ import io
|
|
9 |
from PIL import Image
|
10 |
import os
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
# Initialize FastAPI app
|
13 |
app = FastAPI(title="PromptAgro Image Generator API")
|
14 |
|
|
|
9 |
from PIL import Image
|
10 |
import os
|
11 |
|
12 |
+
|
13 |
+
# Set custom Hugging Face cache directory
|
14 |
+
os.environ["HF_HOME"] = "/app/cache"
|
15 |
+
os.environ["TRANSFORMERS_CACHE"] = "/app/cache"
|
16 |
+
os.environ["HF_HUB_CACHE"] = "/app/cache"
|
17 |
+
|
18 |
# Initialize FastAPI app
|
19 |
app = FastAPI(title="PromptAgro Image Generator API")
|
20 |
|