Skip to content

Commit

Permalink
add support for ood-dev sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
hsnfirooz committed Nov 1, 2024
1 parent 920c2dd commit 7f30c33
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions bin/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ SPEECH2TEXT_CPUS_PER_TASK="6"

CLI=false
OOD=false
OOD-DEV=false

if [ "$#" -gt 0 ]; then
for arg in "$@"; do
Expand All @@ -56,6 +57,9 @@ if [ "$#" -gt 0 ]; then
if [[ "$arg" == "ood" ]]; then
OOD=true
fi
if [[ "$arg" == "ood-dev" ]]; then
OOD-DEV=true
fi
done
else
echo "Provide at least one argument: cli or ood"
Expand Down Expand Up @@ -147,3 +151,35 @@ then
echo ".. OOD files pushed to: $REPO_URL. (Do not forget to run the ansible scripts!)"

fi


# --------------------------------------------------
# Deploy as an Open OnDemand app sandbox app

if [ "$OOD-DEV" = true ]
then

echo "Deploy the Open OnDemand (OOD) sandbox"

SCRIPT="$SCRIPT_DIR"/deploy-data/ood/template/script.sh

sed -i "s|<VERSION>|$VERSION|g" $SCRIPT
sed -i "s|<SPEECH2TEXT>|$SPEECH2TEXT|g" $SCRIPT
sed -i "s|<CONDA_ENV>|$CONDA_ENV|g" $SCRIPT
sed -i "s|<HF_HOME>|$HF_HOME|g" $SCRIPT
sed -i "s|<PYANNOTE_CACHE>|$PYANNOTE_CACHE|g" $SCRIPT
sed -i "s|<TORCH_HOME>|$TORCH_HOME|g" $SCRIPT
sed -i "s|<PYANNOTE_CONFIG>|$PYANNOTE_CONFIG|g" $SCRIPT
sed -i "s|<NUMBA_CACHE_DIR>|$NUMBA_CACHE_DIR|g" $SCRIPT
sed -i "s|<MPLCONFIGDIR>|$MPLCONFIGDIR|g" $SCRIPT
sed -i "s|<SPEECH2TEXT_MEM>|$SPEECH2TEXT_MEM|g" $SCRIPT
sed -i "s|<SPEECH2TEXT_CPUS_PER_TASK>|$SPEECH2TEXT_CPUS_PER_TASK|g" $SCRIPT


USERNAME=$(whoami)
mkdir -p /scratch/work/$USERNAME/.ondemand/dev/speech2text-dev
cp -r bin/deploy-data/ood/* /scratch/work/$USERNAME/.ondemand/dev/speech2text-dev

echo ".. OOD sandbox app is installed!"

fi
2 changes: 1 addition & 1 deletion bin/deploy-data/ood/template/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export SPEECH2TEXT_CPUS_PER_TASK="<SPEECH2TEXT_CPUS_PER_TASK>"

export HF_HUB_OFFLINE="1"

module load speech2text
module load speech2text/"<VERSION>"
speech2text "$audio_path"

0 comments on commit 7f30c33

Please sign in to comment.