Spaces:
Sleeping
Sleeping
Update ToolSet.py
Browse files- ToolSet.py +3 -2
ToolSet.py
CHANGED
@@ -183,6 +183,7 @@ def reverse_text(prompt: str) -> str:
|
|
183 |
def transcribe_audio(file_path: str):
|
184 |
"""
|
185 |
Transcribes an audio file to text using local Whisper model.
|
|
|
186 |
|
187 |
Args:
|
188 |
file_path: Path to the audio file
|
@@ -263,7 +264,7 @@ class YouTubeFrameExtractor:
|
|
263 |
|
264 |
def download_video(self, url: str) -> str:
|
265 |
ydl_opts = {
|
266 |
-
"
|
267 |
'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4',
|
268 |
'outtmpl': '%(id)s.%(ext)s',
|
269 |
}
|
@@ -334,7 +335,7 @@ class YouTubeTranscriber:
|
|
334 |
Download only the audio from a YouTube URL and return the local filename.
|
335 |
"""
|
336 |
ydl_opts = {
|
337 |
-
"
|
338 |
"format": "bestaudio/best", # best available audio :contentReference[oaicite:3]{index=3}
|
339 |
"postprocessors": [{
|
340 |
"key": "FFmpegExtractAudio", # extract with FFmpeg :contentReference[oaicite:4]{index=4}
|
|
|
183 |
def transcribe_audio(file_path: str):
|
184 |
"""
|
185 |
Transcribes an audio file to text using local Whisper model.
|
186 |
+
Then uses the transcription to answer question from the given prompt.
|
187 |
|
188 |
Args:
|
189 |
file_path: Path to the audio file
|
|
|
264 |
|
265 |
def download_video(self, url: str) -> str:
|
266 |
ydl_opts = {
|
267 |
+
"cookiefile": "cookies.txt",
|
268 |
'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4',
|
269 |
'outtmpl': '%(id)s.%(ext)s',
|
270 |
}
|
|
|
335 |
Download only the audio from a YouTube URL and return the local filename.
|
336 |
"""
|
337 |
ydl_opts = {
|
338 |
+
"cookiefile": "cookies.txt",
|
339 |
"format": "bestaudio/best", # best available audio :contentReference[oaicite:3]{index=3}
|
340 |
"postprocessors": [{
|
341 |
"key": "FFmpegExtractAudio", # extract with FFmpeg :contentReference[oaicite:4]{index=4}
|