Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
from whisperplus.pipelines.whisper import SpeechToTextPipeline
|
|
@@ -6,6 +7,8 @@ from whisperplus.utils.download_utils import download_and_convert_to_mp3
|
|
| 6 |
from whisperplus.utils.text_utils import format_speech_to_dialogue
|
| 7 |
|
| 8 |
|
|
|
|
|
|
|
| 9 |
def youtube_url_to_text(url, model_id, language_choice):
|
| 10 |
"""
|
| 11 |
Main function that downloads and converts a video to MP3 format, performs speech-to-text conversion using
|
|
@@ -45,7 +48,7 @@ def speaker_diarization(url, model_id, num_speakers, min_speaker, max_speaker):
|
|
| 45 |
pipeline = ASRDiarizationPipeline.from_pretrained(
|
| 46 |
asr_model=model_id,
|
| 47 |
diarizer_model="pyannote/speaker-diarization",
|
| 48 |
-
use_auth_token=
|
| 49 |
chunk_length_s=30,
|
| 50 |
device="cuda",
|
| 51 |
)
|
|
@@ -106,7 +109,7 @@ def youtube_url_to_text_app():
|
|
| 106 |
gr.Examples(
|
| 107 |
examples=[
|
| 108 |
[
|
| 109 |
-
"https://www.youtube.com/watch?v=
|
| 110 |
"openai/whisper-large-v3",
|
| 111 |
"English",
|
| 112 |
],
|
|
|
|
| 1 |
+
import os
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
from whisperplus.pipelines.whisper import SpeechToTextPipeline
|
|
|
|
| 7 |
from whisperplus.utils.text_utils import format_speech_to_dialogue
|
| 8 |
|
| 9 |
|
| 10 |
+
auth_token = os.getenv('auth_token')
|
| 11 |
+
|
| 12 |
def youtube_url_to_text(url, model_id, language_choice):
|
| 13 |
"""
|
| 14 |
Main function that downloads and converts a video to MP3 format, performs speech-to-text conversion using
|
|
|
|
| 48 |
pipeline = ASRDiarizationPipeline.from_pretrained(
|
| 49 |
asr_model=model_id,
|
| 50 |
diarizer_model="pyannote/speaker-diarization",
|
| 51 |
+
use_auth_token=auth_token,
|
| 52 |
chunk_length_s=30,
|
| 53 |
device="cuda",
|
| 54 |
)
|
|
|
|
| 109 |
gr.Examples(
|
| 110 |
examples=[
|
| 111 |
[
|
| 112 |
+
"https://www.youtube.com/watch?v=hnUYrUzcvqY",
|
| 113 |
"openai/whisper-large-v3",
|
| 114 |
"English",
|
| 115 |
],
|