avraux commited on
Commit ·
36f8d4c
1
Parent(s): 5276a25
endpoint founded
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ class InputData(BaseModel):
|
|
| 19 |
|
| 20 |
@app.get("/")
|
| 21 |
def read_root():
|
| 22 |
-
return {"message": "Welcome to CO2 Prediction for cars !
|
| 23 |
|
| 24 |
|
| 25 |
# Endpoint pour prédiction
|
|
@@ -27,8 +27,4 @@ def read_root():
|
|
| 27 |
def predict(data: InputData):
|
| 28 |
input_json = data.dict()
|
| 29 |
result = preprocess_and_predict(input_json)
|
| 30 |
-
return result
|
| 31 |
-
|
| 32 |
-
@app.get("/test")
|
| 33 |
-
def test_route():
|
| 34 |
-
return {"status": "L'API est en ligne et fonctionnelle"}
|
|
|
|
| 19 |
|
| 20 |
@app.get("/")
|
| 21 |
def read_root():
|
| 22 |
+
return {"message": "Welcome to CO2 Prediction for cars ! To use the prediction endpoint, it's a POST request to https://avraux-co2pred.hf.space/predict. You can see what the body should look like in the README !"}
|
| 23 |
|
| 24 |
|
| 25 |
# Endpoint pour prédiction
|
|
|
|
| 27 |
def predict(data: InputData):
|
| 28 |
input_json = data.dict()
|
| 29 |
result = preprocess_and_predict(input_json)
|
| 30 |
+
return result
|
|
|
|
|
|
|
|
|
|
|
|