smakamali commited on
Commit
982a81a
1 Parent(s): a62e6bb

test HF_TOKEN from server

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -317,8 +317,8 @@ def get_video(url):
317
 
318
  def summarize_youtube_video(url,force_transcribe,use_transcribe_api=False,api_token="",
319
  temperature=1,words=250,use_llm_api=False,do_sample=False):
320
- title,text,transcript_source = transcribe_youtube_video(url,force_transcribe,use_transcribe_api,api_token)
321
- summary, summary_source = summarize_text(title,text,temperature,words,use_llm_api,api_token,do_sample)
322
  return summary, text, transcript_source, summary_source
323
 
324
  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>'
@@ -344,7 +344,7 @@ with gr.Blocks() as demo:
344
  with gr.Column(scale=4):
345
  url = gr.Textbox(label="Enter YouTube video URL here:",placeholder="https://www.youtube.com/watch?v=")
346
  with gr.Column(scale=1):
347
- api_token = gr.Textbox(label="Paste your Hugging Face API token here:",placeholder=HF_TOKEN,visible=False,show_label=True,info='The API token passed via this field is not stored. It is only passed through the Hugging Face Hub API for inference.')
348
  with gr.Column(scale=1):
349
  sum_btn = gr.Button("Summarize!")
350
 
 
317
 
318
  def summarize_youtube_video(url,force_transcribe,use_transcribe_api=False,api_token="",
319
  temperature=1,words=250,use_llm_api=False,do_sample=False):
320
+ title,text,transcript_source = transcribe_youtube_video(url,force_transcribe,use_transcribe_api,HF_TOKEN)
321
+ summary, summary_source = summarize_text(title,text,temperature,words,use_llm_api,HF_TOKEN,do_sample)
322
  return summary, text, transcript_source, summary_source
323
 
324
  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>'
 
344
  with gr.Column(scale=4):
345
  url = gr.Textbox(label="Enter YouTube video URL here:",placeholder="https://www.youtube.com/watch?v=")
346
  with gr.Column(scale=1):
347
+ api_token = gr.Textbox(label="Paste your Hugging Face API token here:",placeholder="hf_...",visible=False,show_label=True,info='The API token passed via this field is not stored. It is only passed through the Hugging Face Hub API for inference.')
348
  with gr.Column(scale=1):
349
  sum_btn = gr.Button("Summarize!")
350