File size: 822 Bytes
957f5bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

# Load token from environment variable
if [ -z "$HUGGING_FACE_TOKEN" ]; then
    echo "Error: HUGGING_FACE_TOKEN environment variable is not set"
    echo "Please set it first with: export HUGGING_FACE_TOKEN='your_token'"
    exit 1
fi

REPO_ID="Sarim-Hash/llava_v6_posix"

python -c "
from huggingface_hub import HfApi
import os

token = os.environ['HUGGING_FACE_TOKEN']
api = HfApi()

try:
    api.upload_folder(
        folder_path='/shared/shashmi/llava_v6_posix/',
        repo_id='$REPO_ID',
        repo_type='model',
        token=token,
        delete_patterns='*',
        ignore_patterns=['*.pyc', '.git*', '.DS_Store', '__pycache__'],
        commit_message='Update model files'
    )
    print('Upload completed successfully')
except Exception as e:
    print(f'Error during upload: {str(e)}')
"