import gradio as gr # List of video files with descriptive names videos = [ ("Karol G", "0.mp4"), ("Angela Aguilar", "1.mp4"), ("Becky G", "2.mp4"), ("Emilia", "3.mp4"), ("Angela Aguilar", "4.mp4"), ("Maria Becerra 0", "5.mp4"), ("Maria Becerra 1", "6.mp4"), ("Maria Becerra 2", "7.mp4"), ("Maria Becerra 3", "8.mp4"), ("Maria Becerra 4", "9.mp4"), ("Maria Becerra 5", "10.mp4"), ("Maria Becerra 6", "11.mp4"), ("Maria Becerra 7", "12.mp4"), ("Maria Becerra 8", "13.mp4"), ("Maria Becerra 9", "14.mp4"), ("Maria Becerra 10", "15.mp4"), ("Bad Gyal", "16.mp4") ] def get_video_path(video_file): # In HuggingFace Spaces, videos should be in the same directory or a subdirectory return video_file with gr.Blocks(title="Robotic Arm Calculator Demonstrations", css=""" .youtube-link { color: #ff0000; font-weight: bold; margin-top: 10px; display: block; } """) as demo: gr.Markdown("# Robotic Arm Calculator Gallery") gr.Markdown("Watch various demonstrations of the robotic arm performing calculator operations.") with gr.Tabs(): for name, video_file in videos: with gr.TabItem(name): gr.Video(get_video_path(video_file), autoplay=False) # Add YouTube link only for Maria Becerra videos if "Maria Becerra" in name: gr.Markdown( f"🎵 [Watch Maria Becerra's music video on YouTube](https://www.youtube.com/watch?v=wkLiuR24Guc&list=RDwkLiuR24Guc&start_radio=1)", elem_classes="youtube-link" ) if __name__ == "__main__": demo.launch()