Skip to content

Commit

Permalink
Merge pull request #10 from TheSeamau5/mistral
Browse files Browse the repository at this point in the history
Shell script to download mistral that actually works
  • Loading branch information
jafioti authored Dec 30, 2023
2 parents d35a40e + 50b47f8 commit 185facb
Showing 1 changed file with 34 additions and 8 deletions.
42 changes: 34 additions & 8 deletions examples/mistral/setup/setup.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# Setup git LFS
echo "Setting up git LFS..."
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo apt install git-lfs
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install git-lfs
# Check if git LFS is installed
if command -v git-lfs &> /dev/null; then
echo "git LFS is already installed."
else
# Install git LFS based on the OS type
echo "Installing git LFS..."
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo apt install git-lfs
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install git-lfs
else
echo "Unsupported operating system."
exit 1
fi
fi

# Setup git LFS
echo "Configuring git LFS..."
git lfs install

echo "Downloading Model..."
git lfs clone https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2 $SCRIPT_DIR/mistral-7b-hf
echo "Done Downloading Model"
# Clone the repo
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2 $SCRIPT_DIR/mistral-7b-hf

# Download the big boi files
echo "Downloading Tokenizer"
curl --location https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2/resolve/main/tokenizer.model?download=true --output $SCRIPT_DIR/mistral-7b-hf/tokenizer.model


echo "Downloading Model Files"

curl\
--parallel --parallel-immediate --parallel-max 3\
--location https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2/resolve/main/model-00001-of-00003.safetensors?download=true --output $SCRIPT_DIR/mistral-7b-hf/model-00001-of-00003.safetensors\
--location https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2/resolve/main/model-00002-of-00003.safetensors?download=true --output $SCRIPT_DIR/mistral-7b-hf/model-00002-of-00003.safetensors\
--location https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2/resolve/main/model-00003-of-00003.safetensors?download=true --output $SCRIPT_DIR/mistral-7b-hf/model-00003-of-00003.safetensors

echo "Done Downloading Model"

0 comments on commit 185facb

Please sign in to comment.