fixed macos code

This commit is contained in:
Saifeddine ALOUI 2023-04-14 00:22:40 +02:00
parent cf593c7c52
commit a6c19e8e79

View File

@ -138,6 +138,7 @@ else
* ) echo "Skipping download of model file...";;
esac
fi
#!/bin/bash
echo ""
echo "Downloading latest model..."
@ -168,7 +169,7 @@ case $yn in
echo "[$count] $f"
done
Prompt user to choose a model to convert
# Prompt user to choose a model to convert
read -p "Enter the number of the model you want to convert: " modelNumber
if [ -z "${file[modelNumber]}" ]; then
@ -182,21 +183,15 @@ case $yn in
echo ""
echo "You selected $modelPath"
Ask user if they want to convert the model
# Ask user if they want to convert the model
echo ""
read -p "Do you want to convert the selected model to the new format? (Y/N)" choice
if [ "$choice" == "N" ]; then
echo ""
echo "Model conversion cancelled. Skipping..."
exit 0
fi
The output inside a code tag
echo "The code has been converted successfully."
esac
else
# Convert the model
echo ""
echo "Converting the model to the new format..."
if [ ! -d "tmp/llama.cpp" ]; then
git clone https://github.com/ggerganov/llama.cpp.git tmp/llama.cpp
@ -207,19 +202,18 @@ if [ $? -ne 0 ]; then
echo ""
echo "Error during model conversion. Restarting..."
mv -f "${modelPath}.original" "${modelPath}"
goto CONVERT_RESTART
exit 1
else
echo ""
echo "The model file (${modelPath}) has been converted to the new format."
goto END
fi
:CANCEL_CONVERSION
echo ""
fi
;;
* ) echo ""
echo "Conversion cancelled. Skipping..."
goto END
;;
esac
:END
echo ""
echo "Cleaning tmp folder"
rm -rf "./tmp"