-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpython
More file actions
38 lines (31 loc) · 1.13 KB
/
Copy pathpython
File metadata and controls
38 lines (31 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
unset PYTHONPATH
unset PYTHONHOME
source /mnt/matylda5/ipoloka/miniconda3/bin/activate /mnt/matylda5/ipoloka/miniconda3/envs/tsasr/
PORT=9049
# Check if port is already in use
if lsof -Pi :$PORT -sTCP:LISTEN -t >/dev/null ; then
echo "Port $PORT is already in use. Port forwarding is already running."
else
# Start port forwarding
ssh -N -D $PORT pcspeech4 &
echo "Port forwarding started on port $PORT."
fi
# If N_GPUS is set, export devices
if [ -n "$N_GPUS" ]; then
export $(/mnt/matylda4/kesiraju/bin/gpus $N_GPUS) || exit 1
echo "Visible devices: ${CUDA_VISIBLE_DEVICES}"
else
export CUDA_VISIBLE_DEVICES=""
fi
export http_proxy=socks5://localhost:$PORT
export https_proxy=socks5://localhost:$PORT
export PYTHONPATH="/mnt/matylda5/ipoloka/projects/TS-ASR-Whisper/src:$PYTHONPATH"
export HF_HOME="/mnt/scratch/tmp/ipoloka/hf_cache"
source /mnt/matylda5/ipoloka/projects/TS-ASR-Whisper/configs/local_paths.sh
# if more than one device is passed, use torchrun to run the script
if [ -n "$N_GPUS" ] && [ "$N_GPUS" -gt 1 ]; then
torchrun --standalone --nnodes=1 --nproc-per-node=$N_GPUS "$@"
else
python "$@"
fi