RamAnanth1 commited on
Commit
d6f7fe8
1 Parent(s): 698ae10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -8,7 +8,7 @@ mode = "transcribe"
8
  write = False
9
  download_path = "tmp/"
10
 
11
- def dataset(url, name):
12
  ds = TranscriptDataset(name)
13
  data = []
14
  #whisper_options = dict(
@@ -19,16 +19,17 @@ def dataset(url, name):
19
  params = dict(model_size=model_size,write=write, number_videos=500)
20
  overwrite = True
21
  ds.generate_dataset(url, download_path, overwrite, params)
22
- ds.upload()
23
 
24
  return "Playlist Name: " + name + "!!"
25
-
26
- gr.Markdown("""## Create Transcription Dataset for Youtube using OpenAI Whisper """)
27
 
28
  yt_input = gr.Textbox(label = 'Youtube Link')
29
  name_input = gr.Textbox(label = 'Dataset Name')
 
30
 
31
  repo_output = gr.Textbox(label = "Outcome")
32
 
33
- iface = gr.Interface(fn=dataset, inputs=[yt_input, name_input], outputs=repo_output)
 
 
34
  iface.launch()
 
8
  write = False
9
  download_path = "tmp/"
10
 
11
+ def dataset(url, name, token):
12
  ds = TranscriptDataset(name)
13
  data = []
14
  #whisper_options = dict(
 
19
  params = dict(model_size=model_size,write=write, number_videos=500)
20
  overwrite = True
21
  ds.generate_dataset(url, download_path, overwrite, params)
22
+ ds.upload(token)
23
 
24
  return "Playlist Name: " + name + "!!"
 
 
25
 
26
  yt_input = gr.Textbox(label = 'Youtube Link')
27
  name_input = gr.Textbox(label = 'Dataset Name')
28
+ token_input = gr.Textbox(placeholder="Write access token")
29
 
30
  repo_output = gr.Textbox(label = "Outcome")
31
 
32
+ iface = gr.Interface(fn=dataset, inputs=[yt_input, name_input, token_input], outputs=repo_output, title="Create Transcription Dataset for Youtube using OpenAI Whisper !",
33
+ description="Create a HuggingFace repository for Youtube Transcripts! You need to specify a write token obtained in https://hf.co/settings/token. This Space is a an experimental demo.",
34
+ article="<p>Find your write token at <a href='https://huggingface.co/settings/token' target='_blank'>token settings</a></p>")
35
  iface.launch()