Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
import os
|
| 2 |
-
|
|
|
|
|
|
|
| 3 |
from fastapi import FastAPI
|
| 4 |
from pydantic import BaseModel
|
| 5 |
import torch
|
|
@@ -44,5 +46,4 @@ def predict_sentiment(data: InputText):
|
|
| 44 |
return {"sentiment": sentiment}
|
| 45 |
|
| 46 |
if __name__ == "__main__":
|
| 47 |
-
uvicorn.run(app, host="0.0.0.0", port=7860)
|
| 48 |
-
os.makedirs("/app/cache", exist_ok=True)
|
|
|
|
| 1 |
import os
|
| 2 |
+
|
| 3 |
+
os.environ["HF_HOME"] = "/tmp/huggingface"
|
| 4 |
+
os.makedirs("/tmp/huggingface", exist_ok=True)
|
| 5 |
from fastapi import FastAPI
|
| 6 |
from pydantic import BaseModel
|
| 7 |
import torch
|
|
|
|
| 46 |
return {"sentiment": sentiment}
|
| 47 |
|
| 48 |
if __name__ == "__main__":
|
| 49 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|