From 63c1e794f75090adaaf4ce599cf6ec7ec867d040 Mon Sep 17 00:00:00 2001 From: hsnfirooz Date: Fri, 1 Nov 2024 12:19:51 +0200 Subject: [PATCH] add tolarence for wierd file names with ondemand inside --- bin/deploy-data/ood/submit.yml.erb | 1 + src/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/deploy-data/ood/submit.yml.erb b/bin/deploy-data/ood/submit.yml.erb index 41ca3e6..4f71127 100644 --- a/bin/deploy-data/ood/submit.yml.erb +++ b/bin/deploy-data/ood/submit.yml.erb @@ -7,6 +7,7 @@ batch_connect: export SPEECH2TEXT_EMAIL=<%= email_field %> export audio_path="<%= audio_path %>" export SPEECH2TEXT_WHISPER_MODEL=<%= model_selector %> + export SPEECH2TEXT_ONDEMAND=true %s script: diff --git a/src/utils.py b/src/utils.py index a930021..99d874e 100644 --- a/src/utils.py +++ b/src/utils.py @@ -55,8 +55,8 @@ def seconds_to_human_readable_format(seconds: int) -> str: def get_tmp_folder(): - current_folder = os.getcwd() - return current_folder if 'ondemand' in current_folder else os.getenv("SPEECH2TEXT_TMP") + ood_folder = os.getcwd() + return ood_folder if os.getenv('SPEECH2TEXT_ONDEMAND') is True else os.getenv("SPEECH2TEXT_TMP") def load_audio(file: str, sr: int = SAMPLE_RATE):