ciditel commited on
Commit
d3e6e92
1 Parent(s): 9ba2a1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -72,20 +72,20 @@ def download_yt_audio(yt_url, filename):
72
 
73
 
74
  def yt_transcribe(yt_url, task, max_filesize=75.0):
75
- html_embed_str = _return_yt_html_embed(yt_url)
76
 
77
- with tempfile.TemporaryDirectory() as tmpdirname:
78
- filepath = os.path.join(tmpdirname, "video.mp4")
79
- download_yt_audio(yt_url, filepath)
80
- with open(filepath, "rb") as f:
81
- inputs = f.read()
82
 
83
- inputs = ffmpeg_read(inputs, pipe.feature_extractor.sampling_rate)
84
- inputs = {"array": inputs, "sampling_rate": pipe.feature_extractor.sampling_rate}
85
 
86
- text = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=True)["text"]
87
 
88
- return html_embed_str, text
89
 
90
 
91
  demo = gr.Blocks()
 
72
 
73
 
74
  def yt_transcribe(yt_url, task, max_filesize=75.0):
75
+ #html_embed_str = _return_yt_html_embed(yt_url)
76
 
77
+ #with tempfile.TemporaryDirectory() as tmpdirname:
78
+ #filepath = os.path.join(tmpdirname, "video.mp4")
79
+ #download_yt_audio(yt_url, filepath)
80
+ #with open(filepath, "rb") as f:
81
+ #inputs = f.read()
82
 
83
+ #inputs = ffmpeg_read(inputs, pipe.feature_extractor.sampling_rate)
84
+ #inputs = {"array": inputs, "sampling_rate": pipe.feature_extractor.sampling_rate}
85
 
86
+ #text = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=True)["text"]
87
 
88
+ return None#html_embed_str, text
89
 
90
 
91
  demo = gr.Blocks()