Fixed training of three models

This commit is contained in:
2026-03-27 19:10:18 +01:00
parent 29fc731e6c
commit 2bcdeb6362
3 changed files with 80 additions and 0 deletions

38
hf_upload.py Normal file
View File

@@ -0,0 +1,38 @@
from pathlib import Path
from huggingface_hub import HfApi, create_repo
REPO_ID = "Syndria98/ultimate-tic-tac-toe-ai"
FILES_TO_UPLOAD = {
"model.py": "model.py",
"game.py": "game.py",
"run.py": "run.py",
"README.md": "README.md",
"easy.pth": "models/easy.pth",
"medium.pth": "models/medium.pth",
"hard.pth": "models/hard.pth",
}
def main():
create_repo(repo_id=REPO_ID, repo_type="model", exist_ok=True)
api = HfApi()
for local_path, repo_path in FILES_TO_UPLOAD.items():
path = Path(local_path)
if not path.exists():
raise FileNotFoundError(f"Missing file: {local_path}")
api.upload_file(
path_or_fileobj=str(path),
path_in_repo=repo_path,
repo_id=REPO_ID,
repo_type="model",
)
print(f"Uploaded {local_path} -> {repo_path}")
if __name__ == "__main__":
main()