chess-roberta-whole-move-pretrained / upload_to_huggingface.py
aamixsh's picture
Run zero_to_fp32.py and commit changes
ab42b4a
raw
history blame contribute delete
778 Bytes
import subprocess
import os
# Define the paths
converter_path = './zero_to_fp32.py'
huggingface_repo = 'https://huggingface.co/TannerGladson/chess-roberta-whole-move-pretrained'
# Extract the model
subprocess.run(['python', converter_path, ".", "pytorch_model.bin"], check=True)
# Commit and push
# Check if the current directory is a git repository
if not os.path.exists('.git'):
result = subprocess.run(['git', 'clone', huggingface_repo, '.'])
if result.returncode != 0:
raise RuntimeError("Failed to clone the repository.")
subprocess.run(['git', 'lfs', 'install'], check=True)
subprocess.run(['git', 'add', '.'], check=True)
subprocess.run(['git', 'commit', '-m', 'Run zero_to_fp32.py and commit changes'], check=True)
subprocess.run(['git', 'push'], check=True)