Instructions to use andrewzhang505/ant_test2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sample-factory
How to use andrewzhang505/ant_test2 with sample-factory:
python -m sample_factory.huggingface.load_from_hub -r andrewzhang505/ant_test2 -d ./train_dir
- Notebooks
- Google Colab
- Kaggle
Download git.diff from andrewzhang505/ant_test2: direct link, hf CLI and curl.
- Browser
- Download file 2.25 kB
-
https://huggingface.co/andrewzhang505/ant_test2/resolve/main/git.diff
- Command line
-
hf download hf://andrewzhang505/ant_test2/git.diff
-
curl -L -o git.diff https://huggingface.co/andrewzhang505/ant_test2/resolve/main/git.diff
2.25 kB
| diff --git a/sample_factory/huggingface/huggingface_utils.py b/sample_factory/huggingface/huggingface_utils.py | |
| index b6b10fc2..88ebd2c4 100644 | |
| --- a/sample_factory/huggingface/huggingface_utils.py | |
| +++ b/sample_factory/huggingface/huggingface_utils.py | |
| def push_to_hf(dir_path: str, repo_name: str, num_policies: int = 1): | |
| exist_ok=True, | |
| ) | |
| - # Upload folders | |
| - folders = [".summary"] | |
| - for policy_id in range(num_policies): | |
| - folders.append(f"checkpoint_p{policy_id}") | |
| - for f in folders: | |
| - if os.path.exists(os.path.join(dir_path, f)): | |
| - upload_folder( | |
| - repo_id=repo_name, | |
| - folder_path=os.path.join(dir_path, f), | |
| - path_in_repo=f, | |
| - ) | |
| - | |
| - # Upload files | |
| - files = ["config.json", "README.md", "replay.mp4"] | |
| - for f in files: | |
| - if os.path.exists(os.path.join(dir_path, f)): | |
| - upload_file( | |
| - repo_id=repo_name, | |
| - path_or_fileobj=os.path.join(dir_path, f), | |
| - path_in_repo=f, | |
| - ) | |
| + upload_folder( | |
| + repo_id=repo_name, | |
| + folder_path=dir_path, | |
| + path_in_repo=f, | |
| + allow_patterns=[ | |
| + ".summary/*", | |
| + "config.json", | |
| + "README.md", | |
| + "replay.mp4", | |
| + ] | |
| + + [f"checkpoint_p{policy_id}/*" for policy_id in range(num_policies)], | |
| + ) | |
| + | |
| + # # Upload folders | |
| + # folders = [".summary"] | |
| + # for policy_id in range(num_policies): | |
| + # folders.append(f"checkpoint_p{policy_id}") | |
| + # for f in folders: | |
| + # if os.path.exists(os.path.join(dir_path, f)): | |
| + # upload_folder( | |
| + # repo_id=repo_name, | |
| + # folder_path=os.path.join(dir_path, f), | |
| + # path_in_repo=f, | |
| + # ) | |
| + | |
| + # # Upload files | |
| + # files = ["config.json", "README.md", "replay.mp4"] | |
| + # for f in files: | |
| + # if os.path.exists(os.path.join(dir_path, f)): | |
| + # upload_file( | |
| + # repo_id=repo_name, | |
| + # path_or_fileobj=os.path.join(dir_path, f), | |
| + # path_in_repo=f, | |
| + # ) | |
| log.info(f"The model has been pushed to {repo_url}") | |