| import gradio as gr | |
| def bmi(w,h): | |
| b = w / h**2 | |
| if b < 18.5: | |
| health = "過輕" | |
| elif b > 24: | |
| health = "過重" | |
| else: | |
| health = "健康" | |
| return b, health | |
| gr.Interface(bmi, ["number", "number"], ["text", "text"],examples=[[80, 1.73],[71, 1.55]]).launch() |
| import gradio as gr | |
| def bmi(w,h): | |
| b = w / h**2 | |
| if b < 18.5: | |
| health = "過輕" | |
| elif b > 24: | |
| health = "過重" | |
| else: | |
| health = "健康" | |
| return b, health | |
| gr.Interface(bmi, ["number", "number"], ["text", "text"],examples=[[80, 1.73],[71, 1.55]]).launch() |