File size: 941 Bytes
54d91ab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash

#SBATCH --job-name=hf_push
#SBATCH --output=log_%j.out
#SBATCH --error=log_%j.err
#SBATCH --partition=longq
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --time=7-00:00
#SBATCH --mem=16000

source ~/.bashrc

# Check if .env file exists and source it
if [ -f .env ]; then
    echo "Sourcing .env file..."
    source .env
else
    echo ".env file not found. Skipping."
fi

echo "MESSAGE: ${MESSAGE}"

# Change to the repository directory
cd "${REPO_PATH}"

# Configure Git credentials
git config credential.helper "store --file=.git-credentials"
echo "https://${HF_USERNAME}:${HF_ACCESS_TOKEN}@huggingface.co" > .git-credentials

git config --global user.name "Lingxi Li"
git config --global user.email "[email protected]"

# Make sure that LFS is setup
git lfs install

# Run git commands
git add .
git commit -m "${MESSAGE}"
git push

# Clean up credentials
# rm .git-credentials
git config --unset credential.helper