upload_models.sh 451 Bytes
Newer Older
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
MODEL_DIR=$1
REMOTE_DIR=$2

if [ ! -d "$MODEL_DIR" ]; then
    echo "Model directory does not exist!"
    exit 1
fi

cd $MODEL_DIR
if [ ! -d ".git" ]; then
    rm -rf .git
fi

git init

git checkout -b main

git lfs install

git lfs track *.bin

git lfs track *.safetensors

git add .

git commit -m "Initial commit"

git remote add origin $REMOTE_DIR

huggingface-cli lfs-enable-largefiles .

git fetch origin

git push -f --set-upstream origin main