Skip to content

Commit

Permalink
add tolarence for wierd file names with ondemand inside
Browse files Browse the repository at this point in the history
  • Loading branch information
hsnfirooz committed Nov 1, 2024
1 parent e5d3767 commit 63c1e79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions bin/deploy-data/ood/submit.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 63c1e79

Please sign in to comment.