Spaces:
Runtime error
Runtime error
Add YT guard
Browse filesSigned-off-by: smajumdar <[email protected]>
app.py
CHANGED
@@ -462,6 +462,14 @@ def _return_yt_html_embed(yt_url):
|
|
462 |
|
463 |
def yt_transcribe(yt_url, model_name):
|
464 |
""" Modified from https://huggingface.co/spaces/whisper-event/whisper-demo """
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
465 |
yt = pt.YouTube(yt_url)
|
466 |
html_embed_str = _return_yt_html_embed(yt_url)
|
467 |
|
|
|
462 |
|
463 |
def yt_transcribe(yt_url, model_name):
|
464 |
""" Modified from https://huggingface.co/spaces/whisper-event/whisper-demo """
|
465 |
+
if yt_url == "":
|
466 |
+
text = ""
|
467 |
+
html_embed_str = ""
|
468 |
+
html_output = build_html_output(f"""
|
469 |
+
Error:- No YouTube URL was provide !
|
470 |
+
""", style='result_item_error')
|
471 |
+
return text, html_embed_str, html_output
|
472 |
+
|
473 |
yt = pt.YouTube(yt_url)
|
474 |
html_embed_str = _return_yt_html_embed(yt_url)
|
475 |
|