Shib-Sankar-Das commited on
Commit
80b19f7
·
1 Parent(s): 6584eb2

Upgrade to TensorFlow 2.18 with latest packages

Browse files
Files changed (2) hide show
  1. app.py +10 -8
  2. requirements.txt +7 -7
app.py CHANGED
@@ -58,17 +58,18 @@ class PredictionRequest(BaseModel):
58
  ..., description="Current activity"
59
  )
60
 
61
- class Config:
62
- schema_extra = {
63
- "example": {
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
- class Config:
82
- schema_extra = {
83
- "example": {
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.100.0
2
- uvicorn[standard]==0.23.0
3
- tensorflow==2.12.0
4
- numpy==1.23.5
5
- scikit-learn==1.3.2
6
- pydantic==1.10.12
7
  python-multipart==0.0.9
8
- h5py==3.8.0
 
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