Spaces:
Sleeping
Sleeping
AnishKumbhar
commited on
Commit
•
146278f
1
Parent(s):
a5519f2
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,27 @@ from fastapi import FastAPI
|
|
2 |
from transformers import pipeline
|
3 |
app = FastAPI(docs_url="/")
|
4 |
@app.get("/calculate-food")
|
5 |
-
def calculate_food_endpoint(activity:
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
"""
|
8 |
Calculates the recommended amount of dog food based on activity level and weight.
|
9 |
|
|
|
2 |
from transformers import pipeline
|
3 |
app = FastAPI(docs_url="/")
|
4 |
@app.get("/calculate-food")
|
5 |
+
def calculate_food_endpoint(activity: str, weight: int):
|
6 |
+
score = 0
|
7 |
+
if activity == "Typical" :
|
8 |
+
score = 110
|
9 |
+
else if activity == "Active" :
|
10 |
+
score = 125
|
11 |
+
else if activity == "Overweight" :
|
12 |
+
score = 70
|
13 |
+
else if activity == "Highly Active" :
|
14 |
+
score = 175
|
15 |
+
else if activity == "Senior, neutered, inactive" :
|
16 |
+
score = 90
|
17 |
+
else if activity == "Working Dog (light duty)" :
|
18 |
+
score = 130
|
19 |
+
else if activity == "Working Dog (moderate duty)" :
|
20 |
+
score = 150
|
21 |
+
else if activity == "Working Dog (heavy duty)" :
|
22 |
+
score = 175
|
23 |
+
else
|
24 |
+
score = 110
|
25 |
+
return round( score / weight, 2)
|
26 |
"""
|
27 |
Calculates the recommended amount of dog food based on activity level and weight.
|
28 |
|