| import gradio as gr |
| import numpy as np |
| import pandas as pd |
| import matplotlib.pyplot as plt |
|
|
| def bmi(name, weight, height): |
| bmi_val = weight / (height ** 2) |
| return "Hello Mr." + name + ", your BMI is " + str(bmi_val) |
| |
| interface = gr.Interface(bmi, |
| inputs = ['text', gr.inputs.Slider(0, 200, label = "Weight in Kg"), gr.inputs.Slider(0, 200, label = "Height in meters")], |
| outputs = ['text'], |
| description = "This would calculate the BMI", |
| examples = [['Abhishek', 100, 200], ['Little', 300, 500], ['Kaushik', 200, 400]], |
| theme = "darkgrass", |
| title = "BMI Demo" |
| ) |
| |
| interface.launch() |