import gradio as gr import os import utils example_video_id = "ErnWZxJovaM" example_output_transcript = utils.load_transcript(example_video_id) example_chapters = utils.load_json_chapters(example_video_id) example_output_html = utils.get_result_as_html(example_chapters, example_video_id) example_video_id_dict = {"MIT Introduction to Deep Learning | 6.S191 - Alexander Amini - 2024": "ErnWZxJovaM", "How to speak - Patrick Winston - 2018": "Unzc731iCUY", "Let's build the GPT Tokenizer - Andrej Karpathy - 2024": "zduSFxRajkE"} example_video_names = list(example_video_id_dict.keys()) def gradio_load_example(example_video): print(f"Loading example: {example_video}") video_id = example_video_id_dict[example_video] transcript_as_text = utils.load_transcript(video_id) chapters = utils.load_json_chapters(video_id) output_html = utils.get_result_as_html(chapters, video_id) return {output_processing: output_html, output_transcript: transcript_as_text} # %% css = """ .content { padding: 20px; max-width: 800px; margin: 0 auto; background-color: #ffffff; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); border-radius: 8px; } """ with (gr.Blocks(css=css) as app): gr.HTML("