Spaces:
Runtime error
Runtime error
add logging
Browse files
app.py
CHANGED
@@ -317,11 +317,13 @@ def get_video(url):
|
|
317 |
|
318 |
def summarize_youtube_video(url,force_transcribe,api_token="",
|
319 |
temperature=1.0,words=150,do_sample=True):
|
|
|
320 |
if api_token == "":
|
321 |
api_token = HF_TOKEN
|
322 |
title,text,transcript_source = transcribe_youtube_video(url,force_transcribe,True,api_token)
|
|
|
323 |
summary, summary_source = summarize_text(title,text,temperature,words,True,api_token,do_sample)
|
324 |
-
print(
|
325 |
return summary, text, transcript_source, summary_source
|
326 |
|
327 |
html = '<iframe width="100%" height="315" src="https://www.youtube.com/embed/" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
|
|
|
317 |
|
318 |
def summarize_youtube_video(url,force_transcribe,api_token="",
|
319 |
temperature=1.0,words=150,do_sample=True):
|
320 |
+
print("URL:",url)
|
321 |
if api_token == "":
|
322 |
api_token = HF_TOKEN
|
323 |
title,text,transcript_source = transcribe_youtube_video(url,force_transcribe,True,api_token)
|
324 |
+
print("Transcript:",text[:500])
|
325 |
summary, summary_source = summarize_text(title,text,temperature,words,True,api_token,do_sample)
|
326 |
+
print("Summary:",summary)
|
327 |
return summary, text, transcript_source, summary_source
|
328 |
|
329 |
html = '<iframe width="100%" height="315" src="https://www.youtube.com/embed/" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
|