import gradio as gr def replay(name): # Get the correct model if (option == "LunarLander-v2 🚀👩‍🚀"): return "./LunarLander-v2.mp4" elif(option == "CartPole-v1 🕹ī¸"): return "./CartPole-v1.mp4" elif(option == "Atari Space Invaders 👾"): return "./SpaceInvadersNoFrameskip-v4.mp4" """ TODO: Next version with live video generation def replay_classical(hf_model_filename, hf_model_id): import gym from stable_baselines3 import PPO from stable_baselines3.common.evaluation import evaluate_policy model = PPO.load_from_huggingface(hf_model_id,hf_model_filename) eval_env = gym.make(option) def replay_atari(hf_model_filename, hf_model_id): """ #iface = gr.Interface(fn=, inputs="dropdown", outputs="text") iface = gr.Interface( replay, [ gr.inputs.Dropdown(["Atari Space Invaders 👾", "CartPole-v1 🕹ī¸", "LunarLander-v2 🚀👩‍🚀 "]), ], "video" ) iface.launch()