ShadyV's picture
Update app.py
d7fb4ec
import gradio as gr
def marks_percent(name, phy, che, mat):
percent = (phy+che+mat)/3
#res_emoji = "😍" if percent > 80 elif "πŸ™‚" percent > 40 and percent<80 else "😭"
res_emoji = "😍" if percent > 80 else "😭"
output_res = "Hello "+name+", Your Percentage is: "+str(percent)+"%"
return (output_res ,res_emoji)
per_interface = gr.Interface(fn = marks_percent,
inputs = ["text", gr.inputs.Slider(0,100, label = "Physics Marks"),
gr.inputs.Slider(0,100, label = "Chemistry Marks"),
gr.inputs.Slider(0,100, label = "Math Marks")],
outputs = ["text", "text"],
examples = [["Alex",79,95,98],
["Megan",99,98,100],
["Joe",75,67,58]],
#live=True,
flagging_options = ["Yes", "No", "Maybe"],
theme = "darkhuggingface",
#css = """
#body {background-color:purple}
#""",
title = "PCM Percentage"
)
per_interface.launch(inline=False)