-
Notifications
You must be signed in to change notification settings - Fork 5
/
run.sh
executable file
·31 lines (24 loc) · 1.07 KB
/
run.sh
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
#!/bin/bash
#
# @author Loreto Parisi (loretoparisi at gmail dot com)
# Copyright (c) 2020-2021 Loreto Parisi (loretoparisi at gmail dot com)
haystack='emotions sentiment summarization asr qa genre gpt_neo audioseg colbert luke msmarco mlpvision bigbird silero_vad bert vit nrot zeroshot hubert gtp_j pokemon projected_gan fasttext whisper alphatensor'
needle=$1
gpu=$2
cache_dir=$3
if [ -z "$cache_dir" ];
then
cache_dir=$(pwd)/models
fi
if [[ " $haystack " =~ .*\ $needle\ .* ]]; then
if [ -z "$gpu" ];
then
echo "Running cpu..."
docker run -e DISPLAY=$DISPLAY -e cache_dir=/app/models -v $cache_dir:"/app/models" --rm -it hfexperiments python ${needle}/run.py
else
echo "Running gpu..."
docker run -e DISPLAY=$DISPLAY -e cache_dir=/workspace/app/models -v $cache_dir:"/workspace/app/models" --rm -it --gpus all hfexperimentsgpu python ${needle}/run.py
fi
else
echo "experiment ${needle} is not supported yet, please open a new [Feature Request: ${needle}] here https://github.com/loretoparisi/hf-experiments/issues/new"
fi