Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -528,14 +528,13 @@ def get_model_options(pipeline_type):
|
|
528 |
# Dictionary to store loaded models
|
529 |
loaded_models = {}
|
530 |
|
531 |
-
def transcribe_audio(audio_input, audio_url,
|
532 |
"""
|
533 |
Transcribes audio from a given source using the specified pipeline and model.
|
534 |
|
535 |
Args:
|
536 |
audio_input (str): Path to uploaded audio file or recorded audio.
|
537 |
audio_url (str): URL of audio.
|
538 |
-
use_tor (bool): Whether to use Tor for downloading.
|
539 |
proxy_url (str): Proxy URL if needed.
|
540 |
proxy_username (str): Proxy username.
|
541 |
proxy_password (str): Proxy password.
|
@@ -574,7 +573,7 @@ def transcribe_audio(audio_input, audio_url, use_tor, proxy_url, proxy_username,
|
|
574 |
is_temp_file = False
|
575 |
elif audio_url is not None and len(audio_url.strip()) > 0:
|
576 |
# audio_url is provided
|
577 |
-
audio_path, is_temp_file = download_audio(audio_url, download_method,
|
578 |
if not audio_path:
|
579 |
error_msg = f"Error downloading audio from {audio_url} using method {download_method}. Check logs for details."
|
580 |
logging.error(error_msg)
|
|
|
528 |
# Dictionary to store loaded models
|
529 |
loaded_models = {}
|
530 |
|
531 |
+
def transcribe_audio(audio_input, audio_url, proxy_url, proxy_username, proxy_password, pipeline_type, model_id, dtype, batch_size, download_method, start_time=None, end_time=None, verbose=False, include_timecodes=False):
|
532 |
"""
|
533 |
Transcribes audio from a given source using the specified pipeline and model.
|
534 |
|
535 |
Args:
|
536 |
audio_input (str): Path to uploaded audio file or recorded audio.
|
537 |
audio_url (str): URL of audio.
|
|
|
538 |
proxy_url (str): Proxy URL if needed.
|
539 |
proxy_username (str): Proxy username.
|
540 |
proxy_password (str): Proxy password.
|
|
|
573 |
is_temp_file = False
|
574 |
elif audio_url is not None and len(audio_url.strip()) > 0:
|
575 |
# audio_url is provided
|
576 |
+
audio_path, is_temp_file = download_audio(audio_url, download_method, proxy_url, proxy_username, proxy_password)
|
577 |
if not audio_path:
|
578 |
error_msg = f"Error downloading audio from {audio_url} using method {download_method}. Check logs for details."
|
579 |
logging.error(error_msg)
|