|
#!/bin/bash |
|
|
|
|
|
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)}') |
|
" |
|
|