Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,10 +4,10 @@ from fastapi import FastAPI
|
|
| 4 |
from pydantic import BaseModel
|
| 5 |
import torch
|
| 6 |
|
| 7 |
-
# ✅ Fix Hugging Face
|
| 8 |
-
os.environ["HF_HOME"] = "/
|
| 9 |
-
os.environ["TRANSFORMERS_CACHE"] = "/
|
| 10 |
-
os.makedirs("/
|
| 11 |
|
| 12 |
# Initialize FastAPI
|
| 13 |
app = FastAPI(title="Check-ins Classifier API", version="1.0")
|
|
@@ -48,3 +48,4 @@ async def predict(data: InputText):
|
|
| 48 |
async def home():
|
| 49 |
return {"message": "Welcome to the Check-ins Classifier API. Use POST /predict to classify text."}
|
| 50 |
|
|
|
|
|
|
| 4 |
from pydantic import BaseModel
|
| 5 |
import torch
|
| 6 |
|
| 7 |
+
# ✅ Fix for Hugging Face Spaces permission issue
|
| 8 |
+
os.environ["HF_HOME"] = "/tmp/hf_cache"
|
| 9 |
+
os.environ["TRANSFORMERS_CACHE"] = "/tmp/hf_cache"
|
| 10 |
+
os.makedirs("/tmp/hf_cache", exist_ok=True)
|
| 11 |
|
| 12 |
# Initialize FastAPI
|
| 13 |
app = FastAPI(title="Check-ins Classifier API", version="1.0")
|
|
|
|
| 48 |
async def home():
|
| 49 |
return {"message": "Welcome to the Check-ins Classifier API. Use POST /predict to classify text."}
|
| 50 |
|
| 51 |
+
|