mirror of
https://github.com/fauxpilot/fauxpilot.git
synced 2025-08-20 21:34:13 -07:00
Allow re-use of converted models
This commit is contained in:
parent
7de9d215f9
commit
6aa53f2eb3
1 changed files with 23 additions and 22 deletions
19
setup.sh
19
setup.sh
|
@ -48,17 +48,15 @@ echo "MODEL=${MODEL}" > config.env
|
||||||
echo "NUM_GPUS=${NUM_GPUS}" >> config.env
|
echo "NUM_GPUS=${NUM_GPUS}" >> config.env
|
||||||
echo "MODEL_DIR=${MODEL_DIR}" >> config.env
|
echo "MODEL_DIR=${MODEL_DIR}" >> config.env
|
||||||
|
|
||||||
if [ -d "$MODEL_DIR"/"${MODEL}"-${NUM_GPUS}gpu ]; then
|
if [ -d "$MODEL_DIR"/"${MODEL}"-"${NUM_GPUS}"gpu ]; then
|
||||||
echo "Converted model for ${MODEL}-${NUM_GPUS}gpu already exists, skipping"
|
echo "Converted model for ${MODEL}-${NUM_GPUS}gpu already exists."
|
||||||
echo "Please delete ${MODEL_DIR}/${MODEL}-${NUM_GPUS}gpu if you want to re-convert it"
|
read -p "Do you want to re-use it? y/n: " REUSE_CHOICE
|
||||||
exit 0
|
if ${REUSE_CHOICE^^} != "Y"; then
|
||||||
fi
|
|
||||||
|
|
||||||
# Create model directory
|
# Create model directory
|
||||||
mkdir -p "${MODEL_DIR}"
|
mkdir -p "${MODEL_DIR}"
|
||||||
|
|
||||||
# For some of the models we can download it preconverted.
|
# For some of the models we can download it pre-converted.
|
||||||
if [ $NUM_GPUS -le 2 ]; then
|
if [ "$NUM_GPUS" -le 2 ]; then
|
||||||
echo "Downloading the model from HuggingFace, this will take a while..."
|
echo "Downloading the model from HuggingFace, this will take a while..."
|
||||||
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
|
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
|
||||||
DEST="${MODEL}-${NUM_GPUS}gpu"
|
DEST="${MODEL}-${NUM_GPUS}gpu"
|
||||||
|
@ -70,6 +68,9 @@ if [ $NUM_GPUS -le 2 ]; then
|
||||||
rm -f "$ARCHIVE"
|
rm -f "$ARCHIVE"
|
||||||
else
|
else
|
||||||
echo "Downloading and converting the model, this will take a while..."
|
echo "Downloading and converting the model, this will take a while..."
|
||||||
docker run --rm -v ${MODEL_DIR}:/models -e MODEL=${MODEL} -e NUM_GPUS=${NUM_GPUS} moyix/model_converter:latest
|
docker run --rm -v "${MODEL_DIR}":/models -e MODEL="${MODEL}" -e NUM_GPUS="${NUM_GPUS}" moyix/model_converter:latest
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Done! Now run ./launch.sh to start the FauxPilot server."
|
echo "Done! Now run ./launch.sh to start the FauxPilot server."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue