def greet(name, time_of_day, temperature, weather): if time_of_day == "morning": salutation = "Good morning" elif time_of_day == "afternoon": salutation = "Good afternoon" elif time_of_day == "evening": salutation = "Good evening" greeting = "%s %s! It is %s degrees today. The weather is %s." % (salutation, name, temperature, weather) celsius = (temperature - 32) * 5 / 9 return greeting, round(celsius, 2) title = "Hello World!" description = """ A simple Hello World application that takes in inputs and returns a greeting. """ article = "Check out more documentation at https://www.gradio.app/getting_started/#getting_started" import gradio as gr demo = gr.Interface( fn=greet, inputs= [gr.Textbox(label = "Name", lines=2, placeholder="Your Name Here..."), gr.Radio(label = "Time of Day", choices = ["morning", "afternoon", "evening"]), gr.Number(label = "Temperature"), gr.Dropdown(label = "Weather", choices = ["rainy", "sunny", "windy"]),], outputs=[gr.Textbox(label = "Greeting"), gr.Number(label = "Temperature in Celsius")], title=title, description=description, article=article, examples=[ ["Umang", "morning", 65, "rainy"], ["Jesse", "afternoon", 87, "sunny"], ["Charreau", "evening", 72, "windy"]] ) demo.launch()