import gradio as gr exercise = { "Back": "Pull-Ups,Bent-Over Rows,Lat Pulldowns,Deadlifts,Single-Arm Dumbbell Rows", "Bicep": "Bicep Curls,Hammer Curls,Concentration Curls,Barbell Curls,Preacher Curls", "Chest": "Bench Press,Incline Dumbbell Press,Push-Ups,Chest Flyes,Dips", "Tricep": "Tricep Dips,Tricep Pushdowns,Overhead Tricep Extension,Skull CrushersClose-Grip Bench Press", "Legs": "Squats,Leg Press,Lunges,Romanian Deadlifts,Leg Curls and Leg Extensions", "Shoulder": "Overhead Press,Lateral Raises,Front Raises,Rear Delt Flyes,Arnold Press", "Abs": "Crunches,Leg Raises,Planks,Russian Twists,Bicycle Crunches" } def get_ex(option): return exercise.get(option, "Invalid option. Please select a number between given choices.") ui = gr.Interface( fn=get_ex, theme="soft", inputs=gr.Dropdown( choices=["Back", "Bicep", "Legs", "Chest","Shoulder","Tricep","Abs"], label="Select body part to train", type="value" ), outputs="text", title="Gym Bot", description="Select an option from the dropdown to get the exercises." ) ui.launch()