Spaces:
Runtime error
Runtime error
[ | |
{ | |
"label": "*", | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"isExtraImport": true, | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"isExtraImport": true, | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"isExtraImport": true, | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "current_ui_lang", | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"isExtraImport": true, | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"isExtraImport": true, | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"isExtraImport": true, | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"isExtraImport": true, | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"isExtraImport": true, | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"isExtraImport": true, | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"isExtraImport": true, | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"isExtraImport": true, | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"isExtraImport": true, | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"isExtraImport": true, | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"isExtraImport": true, | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "AudioSegment", | |
"importPath": "pydub", | |
"description": "pydub", | |
"isExtraImport": true, | |
"detail": "pydub", | |
"documentation": {} | |
}, | |
{ | |
"label": "AudioSegment", | |
"importPath": "pydub", | |
"description": "pydub", | |
"isExtraImport": true, | |
"detail": "pydub", | |
"documentation": {} | |
}, | |
{ | |
"label": "load_groups_json", | |
"importPath": "tool.json_tool", | |
"description": "tool.json_tool", | |
"isExtraImport": true, | |
"detail": "tool.json_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "load_groups_json", | |
"importPath": "tool.json_tool", | |
"description": "tool.json_tool", | |
"isExtraImport": true, | |
"detail": "tool.json_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "os", | |
"kind": 6, | |
"isExtraImport": true, | |
"importPath": "os", | |
"description": "os", | |
"detail": "os", | |
"documentation": {} | |
}, | |
{ | |
"label": "gradio", | |
"kind": 6, | |
"isExtraImport": true, | |
"importPath": "gradio", | |
"description": "gradio", | |
"detail": "gradio", | |
"documentation": {} | |
}, | |
{ | |
"label": "tool.text_file_tool", | |
"kind": 6, | |
"isExtraImport": true, | |
"importPath": "tool.text_file_tool", | |
"description": "tool.text_file_tool", | |
"detail": "tool.text_file_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "Pipeline", | |
"importPath": "pyannote.audio", | |
"description": "pyannote.audio", | |
"isExtraImport": true, | |
"detail": "pyannote.audio", | |
"documentation": {} | |
}, | |
{ | |
"label": "torch", | |
"kind": 6, | |
"isExtraImport": true, | |
"importPath": "torch", | |
"description": "torch", | |
"detail": "torch", | |
"documentation": {} | |
}, | |
{ | |
"label": "json", | |
"kind": 6, | |
"isExtraImport": true, | |
"importPath": "json", | |
"description": "json", | |
"detail": "json", | |
"documentation": {} | |
}, | |
{ | |
"label": "gc", | |
"kind": 6, | |
"isExtraImport": true, | |
"importPath": "gc", | |
"description": "gc", | |
"detail": "gc", | |
"documentation": {} | |
}, | |
{ | |
"label": "start_diarization", | |
"importPath": "main.diarization", | |
"description": "main.diarization", | |
"isExtraImport": true, | |
"detail": "main.diarization", | |
"documentation": {} | |
}, | |
{ | |
"label": "start_transcribe", | |
"importPath": "main.transcribe", | |
"description": "main.transcribe", | |
"isExtraImport": true, | |
"detail": "main.transcribe", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "tool.ffmpeg_tool", | |
"description": "tool.ffmpeg_tool", | |
"isExtraImport": true, | |
"detail": "tool.ffmpeg_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "re", | |
"kind": 6, | |
"isExtraImport": true, | |
"importPath": "re", | |
"description": "re", | |
"detail": "re", | |
"documentation": {} | |
}, | |
{ | |
"label": "openai", | |
"kind": 6, | |
"isExtraImport": true, | |
"importPath": "openai", | |
"description": "openai", | |
"detail": "openai", | |
"documentation": {} | |
}, | |
{ | |
"label": "tiktoken", | |
"kind": 6, | |
"isExtraImport": true, | |
"importPath": "tiktoken", | |
"description": "tiktoken", | |
"detail": "tiktoken", | |
"documentation": {} | |
}, | |
{ | |
"label": "WhisperModel", | |
"importPath": "faster_whisper", | |
"description": "faster_whisper", | |
"isExtraImport": true, | |
"detail": "faster_whisper", | |
"documentation": {} | |
}, | |
{ | |
"label": "ffmpeg", | |
"kind": 6, | |
"isExtraImport": true, | |
"importPath": "ffmpeg", | |
"description": "ffmpeg", | |
"detail": "ffmpeg", | |
"documentation": {} | |
}, | |
{ | |
"label": "gdown", | |
"kind": 6, | |
"isExtraImport": true, | |
"importPath": "gdown", | |
"description": "gdown", | |
"detail": "gdown", | |
"documentation": {} | |
}, | |
{ | |
"label": "get_ui_dict", | |
"importPath": "ui.lang_dictionary", | |
"description": "ui.lang_dictionary", | |
"isExtraImport": true, | |
"detail": "ui.lang_dictionary", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "ui.lang_setting", | |
"description": "ui.lang_setting", | |
"isExtraImport": true, | |
"detail": "ui.lang_setting", | |
"documentation": {} | |
}, | |
{ | |
"label": "*", | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"isExtraImport": true, | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "prepare_input", | |
"importPath": "main.set_up", | |
"description": "main.set_up", | |
"isExtraImport": true, | |
"detail": "main.set_up", | |
"documentation": {} | |
}, | |
{ | |
"label": "prepare_video_subtitle", | |
"importPath": "main.set_up", | |
"description": "main.set_up", | |
"isExtraImport": true, | |
"detail": "main.set_up", | |
"documentation": {} | |
}, | |
{ | |
"label": "get_summary", | |
"importPath": "main.summary", | |
"description": "main.summary", | |
"isExtraImport": true, | |
"detail": "main.summary", | |
"documentation": {} | |
}, | |
{ | |
"label": "get_video_from_url", | |
"importPath": "tool.gdrive_tool", | |
"description": "tool.gdrive_tool", | |
"isExtraImport": true, | |
"detail": "tool.gdrive_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "get_current_sample_file", | |
"kind": 2, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "def get_current_sample_file():\n global speaker_to_name\n global speaker_to_sample_file\n print(f\"GET CURRENT speaker_to_name: {speaker_to_name}\")\n print(f\"GET CURRENT speaker_to_sample: {speaker_to_sample_file}\")\n name = list(speaker_to_name.values())[current_pos]\n sample = list(speaker_to_sample_file.values())[current_pos]\n print(f\"CURRENT: {name} {sample}\")\n return [name, sample]\ndef get_sample_file_for_speakers():", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "get_sample_file_for_speakers", | |
"kind": 2, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "def get_sample_file_for_speakers():\n global sample_groups\n global speaker_to_name\n global speaker_to_sample_file\n sample_groups, _ = load_groups_json()\n print(f\"SAMPLE GROUP: {sample_groups}\")\n speaker_to_name = {}\n speaker_to_sample_file = {}\n for speaker in sample_groups:\n for suffix in range(1, 100):", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "prepare_output", | |
"kind": 2, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "def prepare_output(input_file):\n if input_file is None or not os.path.exists(input_file):\n raise gr.Error(current_ui_lang[\"input_video_warning\"])\n speakers = get_sample_file_for_speakers()\n download_video_update = download_video_subtitle_button.update(\n interactive=True)\n adjust_speaker_update = adjust_speaker.update(\n speakers[0], interactive=True)\n adjust_audio_update = adjust_audio.update(\n speakers[1], interactive=True)", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "change_name", | |
"kind": 2, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "def change_name(to_name):\n global sample_groups\n global speaker_to_name\n global current_pos\n current_speaker = sample_groups[current_pos]\n speaker_to_name[current_speaker] = to_name\n print(str(get_current_sample_file()))\ndef get_speakers_next(to_name):\n change_name(to_name)\n global sample_groups", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "get_speakers_next", | |
"kind": 2, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "def get_speakers_next(to_name):\n change_name(to_name)\n global sample_groups\n global current_pos\n if (current_pos < len(sample_groups) - 1):\n current_pos += 1\n return get_current_sample_file()\ndef get_speakers_previous(to_name):\n change_name(to_name)\n global current_pos", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "get_speakers_previous", | |
"kind": 2, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "def get_speakers_previous(to_name):\n change_name(to_name)\n global current_pos\n if (current_pos > 0):\n current_pos -= 1\n return get_current_sample_file()\ndef start_adjust(to_name, progress=gr.Progress()):\n change_name(to_name)\n # Replacing texts\n progress(0.4, desc=current_ui_lang[\"progress_adjust_speaker\"])", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "start_adjust", | |
"kind": 2, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "def start_adjust(to_name, progress=gr.Progress()):\n change_name(to_name)\n # Replacing texts\n progress(0.4, desc=current_ui_lang[\"progress_adjust_speaker\"])\n transcribe_txt_list, subtitle_txt_list = text_file_tool.read_transcribe_subtitle_file(\n False)\n modified_transcribe = replace_text(transcribe_txt_list)\n modified_subtitle = replace_text(subtitle_txt_list)\n text_file_tool.write_transcribe_subtitle_file(\n modified_transcribe, modified_subtitle, True)", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "replace_text", | |
"kind": 2, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "def replace_text(lines):\n modified_lines = []\n for line in lines:\n for key, value in speaker_to_name.items():\n line = line.replace(key, value)\n print(f\"Replacing {key} with {value}\")\n modified_lines.append(line)\n print(modified_lines)\n return modified_lines", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "min_duration_ms", | |
"kind": 5, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "min_duration_ms = 10000\ncurrent_pos = 0\nspeaker_to_name = {\"Speaker\": \"Name\"}\nspeaker_to_sample_file = {\"Speaker\": \"File\"}\nsample_groups = []\ndef get_current_sample_file():\n global speaker_to_name\n global speaker_to_sample_file\n print(f\"GET CURRENT speaker_to_name: {speaker_to_name}\")\n print(f\"GET CURRENT speaker_to_sample: {speaker_to_sample_file}\")", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "current_pos", | |
"kind": 5, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "current_pos = 0\nspeaker_to_name = {\"Speaker\": \"Name\"}\nspeaker_to_sample_file = {\"Speaker\": \"File\"}\nsample_groups = []\ndef get_current_sample_file():\n global speaker_to_name\n global speaker_to_sample_file\n print(f\"GET CURRENT speaker_to_name: {speaker_to_name}\")\n print(f\"GET CURRENT speaker_to_sample: {speaker_to_sample_file}\")\n name = list(speaker_to_name.values())[current_pos]", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "speaker_to_name", | |
"kind": 5, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "speaker_to_name = {\"Speaker\": \"Name\"}\nspeaker_to_sample_file = {\"Speaker\": \"File\"}\nsample_groups = []\ndef get_current_sample_file():\n global speaker_to_name\n global speaker_to_sample_file\n print(f\"GET CURRENT speaker_to_name: {speaker_to_name}\")\n print(f\"GET CURRENT speaker_to_sample: {speaker_to_sample_file}\")\n name = list(speaker_to_name.values())[current_pos]\n sample = list(speaker_to_sample_file.values())[current_pos]", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "speaker_to_sample_file", | |
"kind": 5, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "speaker_to_sample_file = {\"Speaker\": \"File\"}\nsample_groups = []\ndef get_current_sample_file():\n global speaker_to_name\n global speaker_to_sample_file\n print(f\"GET CURRENT speaker_to_name: {speaker_to_name}\")\n print(f\"GET CURRENT speaker_to_sample: {speaker_to_sample_file}\")\n name = list(speaker_to_name.values())[current_pos]\n sample = list(speaker_to_sample_file.values())[current_pos]\n print(f\"CURRENT: {name} {sample}\")", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "sample_groups", | |
"kind": 5, | |
"importPath": "main.adjust", | |
"description": "main.adjust", | |
"peekOfCode": "sample_groups = []\ndef get_current_sample_file():\n global speaker_to_name\n global speaker_to_sample_file\n print(f\"GET CURRENT speaker_to_name: {speaker_to_name}\")\n print(f\"GET CURRENT speaker_to_sample: {speaker_to_sample_file}\")\n name = list(speaker_to_name.values())[current_pos]\n sample = list(speaker_to_sample_file.values())[current_pos]\n print(f\"CURRENT: {name} {sample}\")\n return [name, sample]", | |
"detail": "main.adjust", | |
"documentation": {} | |
}, | |
{ | |
"label": "start_diarization", | |
"kind": 2, | |
"importPath": "main.diarization", | |
"description": "main.diarization", | |
"peekOfCode": "def start_diarization(input_file):\n diarization = pipeline(input_file)\n sample_groups = []\n speaker_groups = {}\n for turn, _, speaker in diarization.itertracks(yield_label=True):\n if (speaker not in sample_groups):\n sample_groups.append(str(speaker))\n suffix = 1\n file_name = f\"{speaker}-{suffix}\"\n while file_name in speaker_groups:", | |
"detail": "main.diarization", | |
"documentation": {} | |
}, | |
{ | |
"label": "audio_segmentation", | |
"kind": 2, | |
"importPath": "main.diarization", | |
"description": "main.diarization", | |
"peekOfCode": "def audio_segmentation(input_file, speaker_groups_dict):\n audioSegment = AudioSegment.from_wav(input_file)\n for speaker in speaker_groups_dict:\n time = speaker_groups_dict[speaker]\n audioSegment[time[0]*1000: time[1] *\n 1000].export(f\"{speaker}.wav\", format='wav')\n print(f\"group {speaker}: {time[0]*1000}--{time[1]*1000}\")\ndef save_groups_json(input_file, sample_groups_list: list, speaker_groups_dict: dict):\n with open(dir_sample_groups_json, \"w\", encoding=\"utf-8\") as json_file_sample:\n json.dump(sample_groups_list, json_file_sample)", | |
"detail": "main.diarization", | |
"documentation": {} | |
}, | |
{ | |
"label": "save_groups_json", | |
"kind": 2, | |
"importPath": "main.diarization", | |
"description": "main.diarization", | |
"peekOfCode": "def save_groups_json(input_file, sample_groups_list: list, speaker_groups_dict: dict):\n with open(dir_sample_groups_json, \"w\", encoding=\"utf-8\") as json_file_sample:\n json.dump(sample_groups_list, json_file_sample)\n with open(dir_speaker_groups_json, \"w\", encoding=\"utf-8\") as json_file_speaker:\n json.dump(speaker_groups_dict, json_file_speaker)", | |
"detail": "main.diarization", | |
"documentation": {} | |
}, | |
{ | |
"label": "hugging_face_token", | |
"kind": 5, | |
"importPath": "main.diarization", | |
"description": "main.diarization", | |
"peekOfCode": "hugging_face_token = os.environ[\"HUGGING_FACE_TOKEN\"]\npipeline = Pipeline.from_pretrained(\n 'pyannote/speaker-diarization', use_auth_token=hugging_face_token)\nuse_device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\npipeline.to(use_device)\ndef start_diarization(input_file):\n diarization = pipeline(input_file)\n sample_groups = []\n speaker_groups = {}\n for turn, _, speaker in diarization.itertracks(yield_label=True):", | |
"detail": "main.diarization", | |
"documentation": {} | |
}, | |
{ | |
"label": "pipeline", | |
"kind": 5, | |
"importPath": "main.diarization", | |
"description": "main.diarization", | |
"peekOfCode": "pipeline = Pipeline.from_pretrained(\n 'pyannote/speaker-diarization', use_auth_token=hugging_face_token)\nuse_device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\npipeline.to(use_device)\ndef start_diarization(input_file):\n diarization = pipeline(input_file)\n sample_groups = []\n speaker_groups = {}\n for turn, _, speaker in diarization.itertracks(yield_label=True):\n if (speaker not in sample_groups):", | |
"detail": "main.diarization", | |
"documentation": {} | |
}, | |
{ | |
"label": "use_device", | |
"kind": 5, | |
"importPath": "main.diarization", | |
"description": "main.diarization", | |
"peekOfCode": "use_device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\npipeline.to(use_device)\ndef start_diarization(input_file):\n diarization = pipeline(input_file)\n sample_groups = []\n speaker_groups = {}\n for turn, _, speaker in diarization.itertracks(yield_label=True):\n if (speaker not in sample_groups):\n sample_groups.append(str(speaker))\n suffix = 1", | |
"detail": "main.diarization", | |
"documentation": {} | |
}, | |
{ | |
"label": "prepare_input", | |
"kind": 2, | |
"importPath": "main.set_up", | |
"description": "main.set_up", | |
"peekOfCode": "def prepare_input(input_file, start_time, end_time, lang, model_size, progress=gr.Progress()):\n gr.Info(current_ui_lang[\"progress_starting_process\"])\n check_input_video_settings(input_file, start_time, end_time)\n if lang is None:\n raise gr.Error(current_ui_lang[\"lang_radio_warning\"])\n if model_size is None:\n raise gr.Error(current_ui_lang[\"model_dropdown_warning\"])\n print(f\"SOURCE: {input_file}\")\n # Convert video to audio\n progress(0.2, desc=current_ui_lang[\"progress_preparing_video\"])", | |
"detail": "main.set_up", | |
"documentation": {} | |
}, | |
{ | |
"label": "prepare_video_subtitle", | |
"kind": 2, | |
"importPath": "main.set_up", | |
"description": "main.set_up", | |
"peekOfCode": "def prepare_video_subtitle(input_file, start_time, end_time):\n check_input_video_settings(input_file, start_time, end_time)\n gr.Info(current_ui_lang[\"progress_add_subtitle\"])\n # Add subtitle to video\n add_subtitle_to_video()\n # Return to output files\n return [dir_base_transcribe_file, dir_base_subtitle_file, dir_video_subtitle_file]\ndef check_input_video_settings(input_file, start_time, end_time):\n if input_file is None or not os.path.exists(input_file):\n raise gr.Error(current_ui_lang[\"input_video_warning\"])", | |
"detail": "main.set_up", | |
"documentation": {} | |
}, | |
{ | |
"label": "check_input_video_settings", | |
"kind": 2, | |
"importPath": "main.set_up", | |
"description": "main.set_up", | |
"peekOfCode": "def check_input_video_settings(input_file, start_time, end_time):\n if input_file is None or not os.path.exists(input_file):\n raise gr.Error(current_ui_lang[\"input_video_warning\"])\n if validate_time_format(start_time) is False:\n raise gr.Error(current_ui_lang[\"start_time_warning\"])\n if validate_time_format(end_time) is False:\n raise gr.Error(current_ui_lang[\"end_time_warning\"])\n if (check_if_time_invalid(start_time, end_time)):\n raise gr.Error(current_ui_lang[\"time_invalid\"])\ndef validate_time_format(input_string):", | |
"detail": "main.set_up", | |
"documentation": {} | |
}, | |
{ | |
"label": "validate_time_format", | |
"kind": 2, | |
"importPath": "main.set_up", | |
"description": "main.set_up", | |
"peekOfCode": "def validate_time_format(input_string):\n pattern = re.compile(r'^\\d{2}:\\d{2}:\\d{2}$')\n return pattern.match(input_string) is not None\ndef check_if_time_invalid(start_time, end_time):\n start = get_total_seconds(start_time)\n end = get_total_seconds(end_time)\n return start >= end\ndef get_total_seconds(time_string):\n hours, minutes, seconds = map(int, time_string.split(\":\"))\n total_seconds = hours * 3600 + minutes * 60 + seconds", | |
"detail": "main.set_up", | |
"documentation": {} | |
}, | |
{ | |
"label": "check_if_time_invalid", | |
"kind": 2, | |
"importPath": "main.set_up", | |
"description": "main.set_up", | |
"peekOfCode": "def check_if_time_invalid(start_time, end_time):\n start = get_total_seconds(start_time)\n end = get_total_seconds(end_time)\n return start >= end\ndef get_total_seconds(time_string):\n hours, minutes, seconds = map(int, time_string.split(\":\"))\n total_seconds = hours * 3600 + minutes * 60 + seconds\n return total_seconds", | |
"detail": "main.set_up", | |
"documentation": {} | |
}, | |
{ | |
"label": "get_total_seconds", | |
"kind": 2, | |
"importPath": "main.set_up", | |
"description": "main.set_up", | |
"peekOfCode": "def get_total_seconds(time_string):\n hours, minutes, seconds = map(int, time_string.split(\":\"))\n total_seconds = hours * 3600 + minutes * 60 + seconds\n return total_seconds", | |
"detail": "main.set_up", | |
"documentation": {} | |
}, | |
{ | |
"label": "get_summary", | |
"kind": 2, | |
"importPath": "main.summary", | |
"description": "main.summary", | |
"peekOfCode": "def get_summary(lang_choice: int):\n transcribe_list = text_file_tool.read_simple_transcribe_file()\n transcribe = \"\\n\".join(transcribe_list)\n encoding = tiktoken.get_encoding(\"cl100k_base\")\n token_num = len(encoding.encode(transcribe))\n print(f\"Token number is {token_num}\")\n language = [\"English\", \"Bahasa Indonesia\", \"Any\"]\n result = openai.ChatCompletion.create(\n model=\"gpt-3.5-turbo\" if token_num < 4097 else \"gpt-3.5-turbo-16k\",\n messages=[", | |
"detail": "main.summary", | |
"documentation": {} | |
}, | |
{ | |
"label": "openai.api_key", | |
"kind": 5, | |
"importPath": "main.summary", | |
"description": "main.summary", | |
"peekOfCode": "openai.api_key = os.environ[\"OPEN_AI_KEY\"]\ndef get_summary(lang_choice: int):\n transcribe_list = text_file_tool.read_simple_transcribe_file()\n transcribe = \"\\n\".join(transcribe_list)\n encoding = tiktoken.get_encoding(\"cl100k_base\")\n token_num = len(encoding.encode(transcribe))\n print(f\"Token number is {token_num}\")\n language = [\"English\", \"Bahasa Indonesia\", \"Any\"]\n result = openai.ChatCompletion.create(\n model=\"gpt-3.5-turbo\" if token_num < 4097 else \"gpt-3.5-turbo-16k\",", | |
"detail": "main.summary", | |
"documentation": {} | |
}, | |
{ | |
"label": "start_transcribe", | |
"kind": 2, | |
"importPath": "main.transcribe", | |
"description": "main.transcribe", | |
"peekOfCode": "def start_transcribe(lang_choice: int, model_size_choice: int, progress):\n print(\n f\"Starting transcribing with model size {model_size[model_size_choice]} for language {model_lang_list[lang_choice]}\")\n model = WhisperModel(model_size[model_size_choice])\n _, speaker_groups = load_groups_json()\n subtitle_txt_list = []\n transcribe_txt_list = []\n simple_transcribe_txt_list = []\n for speaker, _ in zip(speaker_groups, progress.tqdm(speaker_groups, desc=current_ui_lang[\"progress_transcribing_audio\"])):\n # Transcribe and save temp file", | |
"detail": "main.transcribe", | |
"documentation": {} | |
}, | |
{ | |
"label": "time_str_subtitle", | |
"kind": 2, | |
"importPath": "main.transcribe", | |
"description": "main.transcribe", | |
"peekOfCode": "def time_str_subtitle(t):\n return '{0:02d}:{1:02d}:{2:06.3f}'.format(round(t // 3600),\n round(t % 3600 // 60),\n t % 60)\ndef time_str(t):\n return '{0:02d}:{1:02d}:{2:02d}'.format(round(t // 3600),\n round(t % 3600 // 60),\n round(t % 60))", | |
"detail": "main.transcribe", | |
"documentation": {} | |
}, | |
{ | |
"label": "time_str", | |
"kind": 2, | |
"importPath": "main.transcribe", | |
"description": "main.transcribe", | |
"peekOfCode": "def time_str(t):\n return '{0:02d}:{1:02d}:{2:02d}'.format(round(t // 3600),\n round(t % 3600 // 60),\n round(t % 60))", | |
"detail": "main.transcribe", | |
"documentation": {} | |
}, | |
{ | |
"label": "model_lang_list", | |
"kind": 5, | |
"importPath": "main.transcribe", | |
"description": "main.transcribe", | |
"peekOfCode": "model_lang_list = ['en', 'id', None]\nmodel_size = [\"tiny\", \"base\", \"small\", \"medium\", \"large-v2\"]\ndef start_transcribe(lang_choice: int, model_size_choice: int, progress):\n print(\n f\"Starting transcribing with model size {model_size[model_size_choice]} for language {model_lang_list[lang_choice]}\")\n model = WhisperModel(model_size[model_size_choice])\n _, speaker_groups = load_groups_json()\n subtitle_txt_list = []\n transcribe_txt_list = []\n simple_transcribe_txt_list = []", | |
"detail": "main.transcribe", | |
"documentation": {} | |
}, | |
{ | |
"label": "model_size", | |
"kind": 5, | |
"importPath": "main.transcribe", | |
"description": "main.transcribe", | |
"peekOfCode": "model_size = [\"tiny\", \"base\", \"small\", \"medium\", \"large-v2\"]\ndef start_transcribe(lang_choice: int, model_size_choice: int, progress):\n print(\n f\"Starting transcribing with model size {model_size[model_size_choice]} for language {model_lang_list[lang_choice]}\")\n model = WhisperModel(model_size[model_size_choice])\n _, speaker_groups = load_groups_json()\n subtitle_txt_list = []\n transcribe_txt_list = []\n simple_transcribe_txt_list = []\n for speaker, _ in zip(speaker_groups, progress.tqdm(speaker_groups, desc=current_ui_lang[\"progress_transcribing_audio\"])):", | |
"detail": "main.transcribe", | |
"documentation": {} | |
}, | |
{ | |
"label": "convert_video_to_audio", | |
"kind": 2, | |
"importPath": "tool.ffmpeg_tool", | |
"description": "tool.ffmpeg_tool", | |
"peekOfCode": "def convert_video_to_audio(input_file, start_time, end_time):\n print(\"CONVERTING VIDEO TO AUDIO\")\n print(f\"INPUT: {input_file}\")\n print(f\"OUTPUT: {dir_cut_audio_file}\")\n (\n ffmpeg\n .input(input_file)\n .output(dir_cut_audio_file, ss=start_time, to=end_time, format=\"wav\", acodec='pcm_s16le')\n .run(overwrite_output=True)\n )", | |
"detail": "tool.ffmpeg_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "cut_video", | |
"kind": 2, | |
"importPath": "tool.ffmpeg_tool", | |
"description": "tool.ffmpeg_tool", | |
"peekOfCode": "def cut_video(input_file, start_time, end_time):\n print(\"CUTTING VIDEO\")\n print(f\"INPUT: {input_file}\")\n print(f\"OUTPUT: {dir_cut_video_file}\")\n (\n ffmpeg\n .input(input_file)\n .output(dir_cut_video_file, ss=start_time, to=end_time, acodec='copy', vcodec='copy')\n .run(overwrite_output=True)\n )", | |
"detail": "tool.ffmpeg_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "add_subtitle_to_video", | |
"kind": 2, | |
"importPath": "tool.ffmpeg_tool", | |
"description": "tool.ffmpeg_tool", | |
"peekOfCode": "def add_subtitle_to_video():\n print(\"ADDING SUBTITLE\")\n print(f\"SUBTITLE: {dir_adjusted_subtitle_file}\")\n print(f\"OUTPUT: {dir_video_subtitle_file}\")\n (\n ffmpeg\n .input(dir_cut_video_file)\n .output(dir_video_subtitle_file, vf=f'subtitles={dir_adjusted_subtitle_file}', acodec='copy')\n .run(overwrite_output=True)\n )", | |
"detail": "tool.ffmpeg_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "dir_download_file", | |
"kind": 5, | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"peekOfCode": "dir_download_file = \"download_video.mp4\"\ndir_cut_audio_file = \"cut_audio.wav\"\ndir_cut_video_file = \"cut_video.mp4\"\n# BASE FILE CREATED ONLY ONCE\ndir_base_subtitle_file = \"subtitle.srt\"\ndir_base_transcribe_file = \"transcribe.txt\"\ndir_adjusted_subtitle_file = \"subtitle_adjusted.srt\"\ndir_adjusted_transcribe_file = \"transcribe_adjusted.txt\"\ndir_video_subtitle_file = \"video_subtitle.mp4\"\ndir_sample_groups_json = \"sample_groups.json\"", | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "dir_cut_audio_file", | |
"kind": 5, | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"peekOfCode": "dir_cut_audio_file = \"cut_audio.wav\"\ndir_cut_video_file = \"cut_video.mp4\"\n# BASE FILE CREATED ONLY ONCE\ndir_base_subtitle_file = \"subtitle.srt\"\ndir_base_transcribe_file = \"transcribe.txt\"\ndir_adjusted_subtitle_file = \"subtitle_adjusted.srt\"\ndir_adjusted_transcribe_file = \"transcribe_adjusted.txt\"\ndir_video_subtitle_file = \"video_subtitle.mp4\"\ndir_sample_groups_json = \"sample_groups.json\"\ndir_speaker_groups_json = \"speaker_groups.json\"", | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "dir_cut_video_file", | |
"kind": 5, | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"peekOfCode": "dir_cut_video_file = \"cut_video.mp4\"\n# BASE FILE CREATED ONLY ONCE\ndir_base_subtitle_file = \"subtitle.srt\"\ndir_base_transcribe_file = \"transcribe.txt\"\ndir_adjusted_subtitle_file = \"subtitle_adjusted.srt\"\ndir_adjusted_transcribe_file = \"transcribe_adjusted.txt\"\ndir_video_subtitle_file = \"video_subtitle.mp4\"\ndir_sample_groups_json = \"sample_groups.json\"\ndir_speaker_groups_json = \"speaker_groups.json\"\ndir_simple_transcribe_file = \"simple_transcribe.txt\"", | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "dir_base_subtitle_file", | |
"kind": 5, | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"peekOfCode": "dir_base_subtitle_file = \"subtitle.srt\"\ndir_base_transcribe_file = \"transcribe.txt\"\ndir_adjusted_subtitle_file = \"subtitle_adjusted.srt\"\ndir_adjusted_transcribe_file = \"transcribe_adjusted.txt\"\ndir_video_subtitle_file = \"video_subtitle.mp4\"\ndir_sample_groups_json = \"sample_groups.json\"\ndir_speaker_groups_json = \"speaker_groups.json\"\ndir_simple_transcribe_file = \"simple_transcribe.txt\"", | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "dir_base_transcribe_file", | |
"kind": 5, | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"peekOfCode": "dir_base_transcribe_file = \"transcribe.txt\"\ndir_adjusted_subtitle_file = \"subtitle_adjusted.srt\"\ndir_adjusted_transcribe_file = \"transcribe_adjusted.txt\"\ndir_video_subtitle_file = \"video_subtitle.mp4\"\ndir_sample_groups_json = \"sample_groups.json\"\ndir_speaker_groups_json = \"speaker_groups.json\"\ndir_simple_transcribe_file = \"simple_transcribe.txt\"", | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "dir_adjusted_subtitle_file", | |
"kind": 5, | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"peekOfCode": "dir_adjusted_subtitle_file = \"subtitle_adjusted.srt\"\ndir_adjusted_transcribe_file = \"transcribe_adjusted.txt\"\ndir_video_subtitle_file = \"video_subtitle.mp4\"\ndir_sample_groups_json = \"sample_groups.json\"\ndir_speaker_groups_json = \"speaker_groups.json\"\ndir_simple_transcribe_file = \"simple_transcribe.txt\"", | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "dir_adjusted_transcribe_file", | |
"kind": 5, | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"peekOfCode": "dir_adjusted_transcribe_file = \"transcribe_adjusted.txt\"\ndir_video_subtitle_file = \"video_subtitle.mp4\"\ndir_sample_groups_json = \"sample_groups.json\"\ndir_speaker_groups_json = \"speaker_groups.json\"\ndir_simple_transcribe_file = \"simple_transcribe.txt\"", | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "dir_video_subtitle_file", | |
"kind": 5, | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"peekOfCode": "dir_video_subtitle_file = \"video_subtitle.mp4\"\ndir_sample_groups_json = \"sample_groups.json\"\ndir_speaker_groups_json = \"speaker_groups.json\"\ndir_simple_transcribe_file = \"simple_transcribe.txt\"", | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "dir_sample_groups_json", | |
"kind": 5, | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"peekOfCode": "dir_sample_groups_json = \"sample_groups.json\"\ndir_speaker_groups_json = \"speaker_groups.json\"\ndir_simple_transcribe_file = \"simple_transcribe.txt\"", | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "dir_speaker_groups_json", | |
"kind": 5, | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"peekOfCode": "dir_speaker_groups_json = \"speaker_groups.json\"\ndir_simple_transcribe_file = \"simple_transcribe.txt\"", | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "dir_simple_transcribe_file", | |
"kind": 5, | |
"importPath": "tool.file_name", | |
"description": "tool.file_name", | |
"peekOfCode": "dir_simple_transcribe_file = \"simple_transcribe.txt\"", | |
"detail": "tool.file_name", | |
"documentation": {} | |
}, | |
{ | |
"label": "get_video_from_url", | |
"kind": 2, | |
"importPath": "tool.gdrive_tool", | |
"description": "tool.gdrive_tool", | |
"peekOfCode": "def get_video_from_url(url):\n # Download video from google drive with shareable link\n gr.Info(current_ui_lang[\"get_video_start_info\"])\n download_result = gdown.download(\n url, dir_download_file, quiet=False, fuzzy=True)\n # Raise error if failed\n if (download_result is None):\n raise gr.Error(current_ui_lang[\"get_video_fail_info\"])\n gr.Info(current_ui_lang[\"get_video_finished_info\"])\n return dir_download_file", | |
"detail": "tool.gdrive_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "load_groups_json", | |
"kind": 2, | |
"importPath": "tool.json_tool", | |
"description": "tool.json_tool", | |
"peekOfCode": "def load_groups_json():\n if not os.path.exists(dir_sample_groups_json) or not os.path.exists(dir_speaker_groups_json):\n print(\"JSON file doesn't exist\")\n return [], {}\n with open(dir_sample_groups_json, \"r\", encoding=\"utf-8\") as json_file_sample:\n sample_groups_list: list = json.load(json_file_sample)\n with open(dir_speaker_groups_json, \"r\", encoding=\"utf-8\") as json_file_speaker:\n speaker_groups_dict: dict = json.load(json_file_speaker)\n return sample_groups_list, speaker_groups_dict", | |
"detail": "tool.json_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "write_simple_transcribe_file", | |
"kind": 2, | |
"importPath": "tool.text_file_tool", | |
"description": "tool.text_file_tool", | |
"peekOfCode": "def write_simple_transcribe_file(simple_transcribe_txt_list: list):\n with open(dir_simple_transcribe_file, \"w\", encoding=\"utf-8\") as file:\n file.writelines(simple_transcribe_txt_list)\ndef read_simple_transcribe_file():\n with open(dir_simple_transcribe_file, \"r\", encoding=\"utf-8\") as file:\n simple_transcribe_txt_list = file.readlines()\n return simple_transcribe_txt_list\ndef write_transcribe_subtitle_file(transcribe_txt_list: list, subtitle_txt_list: list, write_adjusted_file: bool):\n transcribe = dir_base_transcribe_file\n subtitle = dir_base_subtitle_file", | |
"detail": "tool.text_file_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "read_simple_transcribe_file", | |
"kind": 2, | |
"importPath": "tool.text_file_tool", | |
"description": "tool.text_file_tool", | |
"peekOfCode": "def read_simple_transcribe_file():\n with open(dir_simple_transcribe_file, \"r\", encoding=\"utf-8\") as file:\n simple_transcribe_txt_list = file.readlines()\n return simple_transcribe_txt_list\ndef write_transcribe_subtitle_file(transcribe_txt_list: list, subtitle_txt_list: list, write_adjusted_file: bool):\n transcribe = dir_base_transcribe_file\n subtitle = dir_base_subtitle_file\n if write_adjusted_file:\n transcribe = dir_adjusted_transcribe_file\n subtitle = dir_adjusted_subtitle_file", | |
"detail": "tool.text_file_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "write_transcribe_subtitle_file", | |
"kind": 2, | |
"importPath": "tool.text_file_tool", | |
"description": "tool.text_file_tool", | |
"peekOfCode": "def write_transcribe_subtitle_file(transcribe_txt_list: list, subtitle_txt_list: list, write_adjusted_file: bool):\n transcribe = dir_base_transcribe_file\n subtitle = dir_base_subtitle_file\n if write_adjusted_file:\n transcribe = dir_adjusted_transcribe_file\n subtitle = dir_adjusted_subtitle_file\n with open(transcribe, \"w\", encoding=\"utf-8\") as file:\n file.writelines(transcribe_txt_list)\n with open(subtitle, \"w\", encoding=\"utf-8\") as file:\n file.writelines(subtitle_txt_list)", | |
"detail": "tool.text_file_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "read_transcribe_subtitle_file", | |
"kind": 2, | |
"importPath": "tool.text_file_tool", | |
"description": "tool.text_file_tool", | |
"peekOfCode": "def read_transcribe_subtitle_file(read_adjusted_file: bool):\n transcribe = dir_base_transcribe_file\n subtitle = dir_base_subtitle_file\n if read_adjusted_file:\n transcribe = dir_adjusted_transcribe_file\n subtitle = dir_adjusted_subtitle_file\n if not os.path.exists(transcribe):\n raise gr.Error(current_ui_lang[\"file_not_exist\"] + \": Transcribe\")\n if not os.path.exists(subtitle):\n raise gr.Error(current_ui_lang[\"file_not_exist\"] + \": Subtitle\")", | |
"detail": "tool.text_file_tool", | |
"documentation": {} | |
}, | |
{ | |
"label": "get_ui_dict", | |
"kind": 2, | |
"importPath": "ui.lang_dictionary", | |
"description": "ui.lang_dictionary", | |
"peekOfCode": "def get_ui_dict(index):\n selectable_ui_lang = [english_ui, indonesia_ui]\n return selectable_ui_lang[index]\nenglish_ui = {\n \"top_markdown\": \"\"\"\n ## Transcribe\n Insert your video and set the options for transcribing\n \"\"\",\n \"middle_markdown\": \"\"\"\n ## Adjustment", | |
"detail": "ui.lang_dictionary", | |
"documentation": {} | |
}, | |
{ | |
"label": "english_ui", | |
"kind": 5, | |
"importPath": "ui.lang_dictionary", | |
"description": "ui.lang_dictionary", | |
"peekOfCode": "english_ui = {\n \"top_markdown\": \"\"\"\n ## Transcribe\n Insert your video and set the options for transcribing\n \"\"\",\n \"middle_markdown\": \"\"\"\n ## Adjustment\n Listen to the clips below and type in the name according to the speaker's sound. After that, please click the 'Adjust Speaker' button to adjust the result above accordingly. \n \"\"\",\n \"bottom_markdown\": \"\"\"", | |
"detail": "ui.lang_dictionary", | |
"documentation": {} | |
}, | |
{ | |
"label": "indonesia_ui", | |
"kind": 5, | |
"importPath": "ui.lang_dictionary", | |
"description": "ui.lang_dictionary", | |
"peekOfCode": "indonesia_ui = {\n \"top_markdown\": \"\"\"\n ## Transkrip\n Masukkan video dan sesuaikan opsi untuk transkrip\n \"\"\",\n \"middle_markdown\": \"\"\"\n ## Penyesuaian\n Dengarkan cuplikan suara pembicara dan ubah nama sesuai suara pembicara. Setelah itu, silahkan tekan tombol 'Sesuaikan Pembicara' untuk menyesuaikan nama pembicara pada hasil di atas\n \"\"\",\n \"bottom_markdown\": \"\"\"", | |
"detail": "ui.lang_dictionary", | |
"documentation": {} | |
}, | |
{ | |
"label": "change_lang", | |
"kind": 2, | |
"importPath": "ui.lang_setting", | |
"description": "ui.lang_setting", | |
"peekOfCode": "def change_lang(input):\n # Change language function\n global current_ui_lang\n current_ui_lang = get_ui_dict(input)\n print(f\"Change language to {available_ui_lang[input]}\")\n return [\n # Top\n top_markdown.update(\n current_ui_lang[\"top_markdown\"]),\n input_url.update(", | |
"detail": "ui.lang_setting", | |
"documentation": {} | |
}, | |
{ | |
"label": "comp_to_update", | |
"kind": 5, | |
"importPath": "ui.lang_setting", | |
"description": "ui.lang_setting", | |
"peekOfCode": "comp_to_update = [\n top_markdown,\n input_url,\n url_download_button,\n input_video,\n start_time,\n end_time,\n lang_radio,\n model_dropdown,\n start_button,", | |
"detail": "ui.lang_setting", | |
"documentation": {} | |
}, | |
{ | |
"label": "ui_lang_index", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "ui_lang_index = 1\navailable_ui_lang = [\"English\", \"Bahasa Indonesia\"]\ncurrent_ui_lang = get_ui_dict(ui_lang_index)\nlang_radio_choice = 1\nmodel_dropdown_choice = 2\n# Transcribe components\nui_lang_radio = gr.Radio(\n available_ui_lang, type=\"index\", value=available_ui_lang[ui_lang_index], interactive=True, show_label=False)\ntop_markdown = gr.Markdown(\n current_ui_lang[\"top_markdown\"])", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "available_ui_lang", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "available_ui_lang = [\"English\", \"Bahasa Indonesia\"]\ncurrent_ui_lang = get_ui_dict(ui_lang_index)\nlang_radio_choice = 1\nmodel_dropdown_choice = 2\n# Transcribe components\nui_lang_radio = gr.Radio(\n available_ui_lang, type=\"index\", value=available_ui_lang[ui_lang_index], interactive=True, show_label=False)\ntop_markdown = gr.Markdown(\n current_ui_lang[\"top_markdown\"])\ninput_url = gr.Textbox(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "current_ui_lang", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "current_ui_lang = get_ui_dict(ui_lang_index)\nlang_radio_choice = 1\nmodel_dropdown_choice = 2\n# Transcribe components\nui_lang_radio = gr.Radio(\n available_ui_lang, type=\"index\", value=available_ui_lang[ui_lang_index], interactive=True, show_label=False)\ntop_markdown = gr.Markdown(\n current_ui_lang[\"top_markdown\"])\ninput_url = gr.Textbox(\n max_lines=1, label=current_ui_lang[\"input_url_label\"], info=current_ui_lang[\"input_url_info\"], interactive=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "lang_radio_choice", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "lang_radio_choice = 1\nmodel_dropdown_choice = 2\n# Transcribe components\nui_lang_radio = gr.Radio(\n available_ui_lang, type=\"index\", value=available_ui_lang[ui_lang_index], interactive=True, show_label=False)\ntop_markdown = gr.Markdown(\n current_ui_lang[\"top_markdown\"])\ninput_url = gr.Textbox(\n max_lines=1, label=current_ui_lang[\"input_url_label\"], info=current_ui_lang[\"input_url_info\"], interactive=True)\nurl_download_button = gr.Button(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "model_dropdown_choice", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "model_dropdown_choice = 2\n# Transcribe components\nui_lang_radio = gr.Radio(\n available_ui_lang, type=\"index\", value=available_ui_lang[ui_lang_index], interactive=True, show_label=False)\ntop_markdown = gr.Markdown(\n current_ui_lang[\"top_markdown\"])\ninput_url = gr.Textbox(\n max_lines=1, label=current_ui_lang[\"input_url_label\"], info=current_ui_lang[\"input_url_info\"], interactive=True)\nurl_download_button = gr.Button(\n current_ui_lang[\"download_button_value\"], size='sm', interactive=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "ui_lang_radio", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "ui_lang_radio = gr.Radio(\n available_ui_lang, type=\"index\", value=available_ui_lang[ui_lang_index], interactive=True, show_label=False)\ntop_markdown = gr.Markdown(\n current_ui_lang[\"top_markdown\"])\ninput_url = gr.Textbox(\n max_lines=1, label=current_ui_lang[\"input_url_label\"], info=current_ui_lang[\"input_url_info\"], interactive=True)\nurl_download_button = gr.Button(\n current_ui_lang[\"download_button_value\"], size='sm', interactive=True)\ninput_video = gr.Video(\n label=current_ui_lang[\"input_video_label\"], interactive=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "top_markdown", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "top_markdown = gr.Markdown(\n current_ui_lang[\"top_markdown\"])\ninput_url = gr.Textbox(\n max_lines=1, label=current_ui_lang[\"input_url_label\"], info=current_ui_lang[\"input_url_info\"], interactive=True)\nurl_download_button = gr.Button(\n current_ui_lang[\"download_button_value\"], size='sm', interactive=True)\ninput_video = gr.Video(\n label=current_ui_lang[\"input_video_label\"], interactive=True)\nstart_time = gr.Textbox(\n \"00:00:00\", max_lines=1, placeholder=\"00:00:00\", label=current_ui_lang[\"start_time_label\"], interactive=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "input_url", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "input_url = gr.Textbox(\n max_lines=1, label=current_ui_lang[\"input_url_label\"], info=current_ui_lang[\"input_url_info\"], interactive=True)\nurl_download_button = gr.Button(\n current_ui_lang[\"download_button_value\"], size='sm', interactive=True)\ninput_video = gr.Video(\n label=current_ui_lang[\"input_video_label\"], interactive=True)\nstart_time = gr.Textbox(\n \"00:00:00\", max_lines=1, placeholder=\"00:00:00\", label=current_ui_lang[\"start_time_label\"], interactive=True)\nend_time = gr.Textbox(\n \"00:15:00\", max_lines=1, placeholder=\"99:99:99\", label=current_ui_lang[\"end_time_label\"], interactive=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "url_download_button", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "url_download_button = gr.Button(\n current_ui_lang[\"download_button_value\"], size='sm', interactive=True)\ninput_video = gr.Video(\n label=current_ui_lang[\"input_video_label\"], interactive=True)\nstart_time = gr.Textbox(\n \"00:00:00\", max_lines=1, placeholder=\"00:00:00\", label=current_ui_lang[\"start_time_label\"], interactive=True)\nend_time = gr.Textbox(\n \"00:15:00\", max_lines=1, placeholder=\"99:99:99\", label=current_ui_lang[\"end_time_label\"], interactive=True)\nlang_radio = gr.Radio(\n current_ui_lang[\"lang_radio_choices\"], label=current_ui_lang[\"lang_radio_label\"], info=current_ui_lang[\"lang_radio_info\"], type='index', interactive=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "input_video", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "input_video = gr.Video(\n label=current_ui_lang[\"input_video_label\"], interactive=True)\nstart_time = gr.Textbox(\n \"00:00:00\", max_lines=1, placeholder=\"00:00:00\", label=current_ui_lang[\"start_time_label\"], interactive=True)\nend_time = gr.Textbox(\n \"00:15:00\", max_lines=1, placeholder=\"99:99:99\", label=current_ui_lang[\"end_time_label\"], interactive=True)\nlang_radio = gr.Radio(\n current_ui_lang[\"lang_radio_choices\"], label=current_ui_lang[\"lang_radio_label\"], info=current_ui_lang[\"lang_radio_info\"], type='index', interactive=True)\nmodel_dropdown = gr.Dropdown(\n current_ui_lang[\"model_dropdown_choices\"], label=current_ui_lang[\"model_dropdown_label\"], info=current_ui_lang[\"model_dropdown_info\"], type='index', interactive=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "start_time", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "start_time = gr.Textbox(\n \"00:00:00\", max_lines=1, placeholder=\"00:00:00\", label=current_ui_lang[\"start_time_label\"], interactive=True)\nend_time = gr.Textbox(\n \"00:15:00\", max_lines=1, placeholder=\"99:99:99\", label=current_ui_lang[\"end_time_label\"], interactive=True)\nlang_radio = gr.Radio(\n current_ui_lang[\"lang_radio_choices\"], label=current_ui_lang[\"lang_radio_label\"], info=current_ui_lang[\"lang_radio_info\"], type='index', interactive=True)\nmodel_dropdown = gr.Dropdown(\n current_ui_lang[\"model_dropdown_choices\"], label=current_ui_lang[\"model_dropdown_label\"], info=current_ui_lang[\"model_dropdown_info\"], type='index', interactive=True)\nstart_button = gr.Button(\n current_ui_lang[\"start_button_value\"], variant=\"primary\", interactive=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "end_time", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "end_time = gr.Textbox(\n \"00:15:00\", max_lines=1, placeholder=\"99:99:99\", label=current_ui_lang[\"end_time_label\"], interactive=True)\nlang_radio = gr.Radio(\n current_ui_lang[\"lang_radio_choices\"], label=current_ui_lang[\"lang_radio_label\"], info=current_ui_lang[\"lang_radio_info\"], type='index', interactive=True)\nmodel_dropdown = gr.Dropdown(\n current_ui_lang[\"model_dropdown_choices\"], label=current_ui_lang[\"model_dropdown_label\"], info=current_ui_lang[\"model_dropdown_info\"], type='index', interactive=True)\nstart_button = gr.Button(\n current_ui_lang[\"start_button_value\"], variant=\"primary\", interactive=True)\n# Adjust components\nmiddle_markdown = gr.Markdown(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "lang_radio", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "lang_radio = gr.Radio(\n current_ui_lang[\"lang_radio_choices\"], label=current_ui_lang[\"lang_radio_label\"], info=current_ui_lang[\"lang_radio_info\"], type='index', interactive=True)\nmodel_dropdown = gr.Dropdown(\n current_ui_lang[\"model_dropdown_choices\"], label=current_ui_lang[\"model_dropdown_label\"], info=current_ui_lang[\"model_dropdown_info\"], type='index', interactive=True)\nstart_button = gr.Button(\n current_ui_lang[\"start_button_value\"], variant=\"primary\", interactive=True)\n# Adjust components\nmiddle_markdown = gr.Markdown(\n current_ui_lang[\"middle_markdown\"])\nadjust_audio = gr.Audio(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "model_dropdown", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "model_dropdown = gr.Dropdown(\n current_ui_lang[\"model_dropdown_choices\"], label=current_ui_lang[\"model_dropdown_label\"], info=current_ui_lang[\"model_dropdown_info\"], type='index', interactive=True)\nstart_button = gr.Button(\n current_ui_lang[\"start_button_value\"], variant=\"primary\", interactive=True)\n# Adjust components\nmiddle_markdown = gr.Markdown(\n current_ui_lang[\"middle_markdown\"])\nadjust_audio = gr.Audio(\n interactive=False)\nadjust_speaker = gr.Textbox(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "start_button", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "start_button = gr.Button(\n current_ui_lang[\"start_button_value\"], variant=\"primary\", interactive=True)\n# Adjust components\nmiddle_markdown = gr.Markdown(\n current_ui_lang[\"middle_markdown\"])\nadjust_audio = gr.Audio(\n interactive=False)\nadjust_speaker = gr.Textbox(\n label=current_ui_lang[\"adjust_speaker_value\"], interactive=False)\nprev_button = gr.Button(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "middle_markdown", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "middle_markdown = gr.Markdown(\n current_ui_lang[\"middle_markdown\"])\nadjust_audio = gr.Audio(\n interactive=False)\nadjust_speaker = gr.Textbox(\n label=current_ui_lang[\"adjust_speaker_value\"], interactive=False)\nprev_button = gr.Button(\n current_ui_lang[\"prev_button_value\"], interactive=False)\nnext_button = gr.Button(\n current_ui_lang[\"next_button_value\"], interactive=False)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "adjust_audio", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "adjust_audio = gr.Audio(\n interactive=False)\nadjust_speaker = gr.Textbox(\n label=current_ui_lang[\"adjust_speaker_value\"], interactive=False)\nprev_button = gr.Button(\n current_ui_lang[\"prev_button_value\"], interactive=False)\nnext_button = gr.Button(\n current_ui_lang[\"next_button_value\"], interactive=False)\nadjust_button = gr.Button(\n current_ui_lang[\"adjust_button_value\"], variant=\"primary\", interactive=False)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "adjust_speaker", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "adjust_speaker = gr.Textbox(\n label=current_ui_lang[\"adjust_speaker_value\"], interactive=False)\nprev_button = gr.Button(\n current_ui_lang[\"prev_button_value\"], interactive=False)\nnext_button = gr.Button(\n current_ui_lang[\"next_button_value\"], interactive=False)\nadjust_button = gr.Button(\n current_ui_lang[\"adjust_button_value\"], variant=\"primary\", interactive=False)\n# Result components\nbottom_markdown = gr.Markdown(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "prev_button", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "prev_button = gr.Button(\n current_ui_lang[\"prev_button_value\"], interactive=False)\nnext_button = gr.Button(\n current_ui_lang[\"next_button_value\"], interactive=False)\nadjust_button = gr.Button(\n current_ui_lang[\"adjust_button_value\"], variant=\"primary\", interactive=False)\n# Result components\nbottom_markdown = gr.Markdown(\n current_ui_lang[\"bottom_markdown\"])\noutput_video = gr.Video(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "next_button", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "next_button = gr.Button(\n current_ui_lang[\"next_button_value\"], interactive=False)\nadjust_button = gr.Button(\n current_ui_lang[\"adjust_button_value\"], variant=\"primary\", interactive=False)\n# Result components\nbottom_markdown = gr.Markdown(\n current_ui_lang[\"bottom_markdown\"])\noutput_video = gr.Video(\n label=current_ui_lang[\"output_video_label\"], interactive=False)\ndownload_video_subtitle_button = gr.Button(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "adjust_button", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "adjust_button = gr.Button(\n current_ui_lang[\"adjust_button_value\"], variant=\"primary\", interactive=False)\n# Result components\nbottom_markdown = gr.Markdown(\n current_ui_lang[\"bottom_markdown\"])\noutput_video = gr.Video(\n label=current_ui_lang[\"output_video_label\"], interactive=False)\ndownload_video_subtitle_button = gr.Button(\n current_ui_lang[\"download_video_button_value\"], interactive=False, size='sm')\noutput_file = gr.File(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "bottom_markdown", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "bottom_markdown = gr.Markdown(\n current_ui_lang[\"bottom_markdown\"])\noutput_video = gr.Video(\n label=current_ui_lang[\"output_video_label\"], interactive=False)\ndownload_video_subtitle_button = gr.Button(\n current_ui_lang[\"download_video_button_value\"], interactive=False, size='sm')\noutput_file = gr.File(\n file_count=\"multiple\", interactive=False)\noutput_transcribe = gr.Textbox(\n label=current_ui_lang[\"output_transcribe_label\"], interactive=False, show_copy_button=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "output_video", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "output_video = gr.Video(\n label=current_ui_lang[\"output_video_label\"], interactive=False)\ndownload_video_subtitle_button = gr.Button(\n current_ui_lang[\"download_video_button_value\"], interactive=False, size='sm')\noutput_file = gr.File(\n file_count=\"multiple\", interactive=False)\noutput_transcribe = gr.Textbox(\n label=current_ui_lang[\"output_transcribe_label\"], interactive=False, show_copy_button=True)\n# Summary components\nsummary_markdown = gr.Markdown(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "download_video_subtitle_button", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "download_video_subtitle_button = gr.Button(\n current_ui_lang[\"download_video_button_value\"], interactive=False, size='sm')\noutput_file = gr.File(\n file_count=\"multiple\", interactive=False)\noutput_transcribe = gr.Textbox(\n label=current_ui_lang[\"output_transcribe_label\"], interactive=False, show_copy_button=True)\n# Summary components\nsummary_markdown = gr.Markdown(\n current_ui_lang[\"summary_markdown\"])\nsummary_button = gr.Button(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "output_file", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "output_file = gr.File(\n file_count=\"multiple\", interactive=False)\noutput_transcribe = gr.Textbox(\n label=current_ui_lang[\"output_transcribe_label\"], interactive=False, show_copy_button=True)\n# Summary components\nsummary_markdown = gr.Markdown(\n current_ui_lang[\"summary_markdown\"])\nsummary_button = gr.Button(\n current_ui_lang[\"summary_button_value\"], variant=\"primary\", interactive=False)\noutput_summary = gr.Textbox(", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "output_transcribe", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "output_transcribe = gr.Textbox(\n label=current_ui_lang[\"output_transcribe_label\"], interactive=False, show_copy_button=True)\n# Summary components\nsummary_markdown = gr.Markdown(\n current_ui_lang[\"summary_markdown\"])\nsummary_button = gr.Button(\n current_ui_lang[\"summary_button_value\"], variant=\"primary\", interactive=False)\noutput_summary = gr.Textbox(\n label=current_ui_lang[\"output_summary_label\"], interactive=False, show_copy_button=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "summary_markdown", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "summary_markdown = gr.Markdown(\n current_ui_lang[\"summary_markdown\"])\nsummary_button = gr.Button(\n current_ui_lang[\"summary_button_value\"], variant=\"primary\", interactive=False)\noutput_summary = gr.Textbox(\n label=current_ui_lang[\"output_summary_label\"], interactive=False, show_copy_button=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "summary_button", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "summary_button = gr.Button(\n current_ui_lang[\"summary_button_value\"], variant=\"primary\", interactive=False)\noutput_summary = gr.Textbox(\n label=current_ui_lang[\"output_summary_label\"], interactive=False, show_copy_button=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
}, | |
{ | |
"label": "output_summary", | |
"kind": 5, | |
"importPath": "ui.ui_component", | |
"description": "ui.ui_component", | |
"peekOfCode": "output_summary = gr.Textbox(\n label=current_ui_lang[\"output_summary_label\"], interactive=False, show_copy_button=True)", | |
"detail": "ui.ui_component", | |
"documentation": {} | |
} | |
] |