Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,20 +18,10 @@ def calculate_bmi(Name,height_cm, weight_kg):
|
|
18 |
category = "Obesity"
|
19 |
emoji = "π±"
|
20 |
|
21 |
-
return f"Name : {Name}\n\nYour BMI: {bmi:.2f}\nCategory: {category}
|
22 |
|
23 |
-
bmi = gr.Interface(fn=calculate_bmi,
|
24 |
-
inputs=['text',
|
25 |
-
gr.Slider(0,220, label="Height in cm"),
|
26 |
-
gr.Slider(0,130, label="Weight in kg")],
|
27 |
-
outputs = "text",
|
28 |
-
title="BMI Calculator in Metrics",
|
29 |
-
description="Calculate your BMI (Body Mass Index) based on height **(cm)** and weight **(kg)**.\n\nDeveloped by: Parthebhan Pari \n\n**BMI Categories:**\n- Underweight = <18.5\n- Normal weight = 18.5β24.9\n- Overweight = 25β29.9\n- Obesity = BMI of 30 or greater"
|
30 |
-
|
31 |
-
)
|
32 |
-
|
33 |
# Custom CSS for dark theme
|
34 |
-
|
35 |
body {
|
36 |
background-color: #121212;
|
37 |
color: #FFFFFF;
|
@@ -39,6 +29,16 @@ bmi.css("""
|
|
39 |
.gradio-interface {
|
40 |
box-shadow: none;
|
41 |
}
|
42 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
bmi.launch(share=True)
|
|
|
18 |
category = "Obesity"
|
19 |
emoji = "π±"
|
20 |
|
21 |
+
return f"Name : {Name}\n\nYour BMI: {bmi:.2f}\nCategory: {category} {emoji} "
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
# Custom CSS for dark theme
|
24 |
+
custom_css = """
|
25 |
body {
|
26 |
background-color: #121212;
|
27 |
color: #FFFFFF;
|
|
|
29 |
.gradio-interface {
|
30 |
box-shadow: none;
|
31 |
}
|
32 |
+
"""
|
33 |
+
|
34 |
+
bmi = gr.Interface(fn=calculate_bmi,
|
35 |
+
inputs=['text',
|
36 |
+
gr.Slider(0, 220, label="Height in cm"),
|
37 |
+
gr.Slider(0, 130, label="Weight in kg")],
|
38 |
+
outputs="text",
|
39 |
+
title="BMI Calculator in Metrics",
|
40 |
+
description="Calculate your BMI (Body Mass Index) based on height **(cm)** and weight **(kg)**.\n\nDeveloped by: Parthebhan Pari \n\n**BMI Categories:**\n- Underweight = <18.5\n- Normal weight = 18.5β24.9\n- Overweight = 25β29.9\n- Obesity = BMI of 30 or greater",
|
41 |
+
css=custom_css # Apply custom CSS here
|
42 |
+
)
|
43 |
|
44 |
bmi.launch(share=True)
|