Spaces:
Sleeping
Sleeping
Commit ·
80b19f7
1
Parent(s): 6584eb2
Upgrade to TensorFlow 2.18 with latest packages
Browse files- app.py +10 -8
- requirements.txt +7 -7
app.py
CHANGED
|
@@ -58,17 +58,18 @@ class PredictionRequest(BaseModel):
|
|
| 58 |
..., description="Current activity"
|
| 59 |
)
|
| 60 |
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
"
|
| 64 |
"gender": "Male",
|
| 65 |
"age": 25,
|
| 66 |
"weight": 70.5,
|
| 67 |
"heartrate": 120,
|
| 68 |
"stepcount": 5000,
|
| 69 |
"activity": "Running"
|
| 70 |
-
}
|
| 71 |
}
|
|
|
|
| 72 |
|
| 73 |
|
| 74 |
# Response model
|
|
@@ -78,9 +79,9 @@ class PredictionResponse(BaseModel):
|
|
| 78 |
confidence: str
|
| 79 |
input_data: dict
|
| 80 |
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
"
|
| 84 |
"panic_detected": True,
|
| 85 |
"panic_probability": 0.85,
|
| 86 |
"confidence": "high",
|
|
@@ -92,8 +93,9 @@ class PredictionResponse(BaseModel):
|
|
| 92 |
"stepcount": 5000,
|
| 93 |
"activity": "Running"
|
| 94 |
}
|
| 95 |
-
}
|
| 96 |
}
|
|
|
|
| 97 |
|
| 98 |
|
| 99 |
@app.get("/")
|
|
|
|
| 58 |
..., description="Current activity"
|
| 59 |
)
|
| 60 |
|
| 61 |
+
model_config = {
|
| 62 |
+
"json_schema_extra": {
|
| 63 |
+
"examples": [{
|
| 64 |
"gender": "Male",
|
| 65 |
"age": 25,
|
| 66 |
"weight": 70.5,
|
| 67 |
"heartrate": 120,
|
| 68 |
"stepcount": 5000,
|
| 69 |
"activity": "Running"
|
| 70 |
+
}]
|
| 71 |
}
|
| 72 |
+
}
|
| 73 |
|
| 74 |
|
| 75 |
# Response model
|
|
|
|
| 79 |
confidence: str
|
| 80 |
input_data: dict
|
| 81 |
|
| 82 |
+
model_config = {
|
| 83 |
+
"json_schema_extra": {
|
| 84 |
+
"examples": [{
|
| 85 |
"panic_detected": True,
|
| 86 |
"panic_probability": 0.85,
|
| 87 |
"confidence": "high",
|
|
|
|
| 93 |
"stepcount": 5000,
|
| 94 |
"activity": "Running"
|
| 95 |
}
|
| 96 |
+
}]
|
| 97 |
}
|
| 98 |
+
}
|
| 99 |
|
| 100 |
|
| 101 |
@app.get("/")
|
requirements.txt
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
-
fastapi==0.
|
| 2 |
-
uvicorn[standard]==0.
|
| 3 |
-
tensorflow==2.
|
| 4 |
-
numpy==
|
| 5 |
-
scikit-learn==1.
|
| 6 |
-
pydantic==
|
| 7 |
python-multipart==0.0.9
|
| 8 |
-
h5py==3.
|
|
|
|
| 1 |
+
fastapi==0.115.0
|
| 2 |
+
uvicorn[standard]==0.32.0
|
| 3 |
+
tensorflow==2.18.0
|
| 4 |
+
numpy==2.0.2
|
| 5 |
+
scikit-learn==1.5.2
|
| 6 |
+
pydantic==2.9.0
|
| 7 |
python-multipart==0.0.9
|
| 8 |
+
h5py==3.12.1
|