lilingxi01's picture
chore: init commit.
54d91ab
#!/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 "lilingxi01@gmail.com"
# 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