deep-rl-class icon indicating copy to clipboard operation
deep-rl-class copied to clipboard

[FIX] Wrong Huggy path when pushing to Hub

Open Laz4rz opened this issue 9 months ago • 2 comments

Current version of pushing Huggy to Hub:

!mlagents-push-to-hf --run-id="HuggyTraining" --local-dir="./results/Huggy2" --repo-id="Laz4rz/hf-huggy-1-bonus" --commit-message="add Huggy agent"

yields:

[INFO] This function will create a model card and upload your HuggyTraining into HuggingFace Hub. This is a work in progress: If you encounter a bug, please send open an issue
Traceback (most recent call last):
  File "/usr/local/bin/mlagents-push-to-hf", line 33, in <module>
    sys.exit(load_entry_point('mlagents', 'console_scripts', 'mlagents-push-to-hf')())
  File "/content/ml-agents/ml-agents/mlagents/utils/push_to_hf.py", line 205, in main
    package_to_hub(
  File "/content/ml-agents/ml-agents/mlagents/utils/push_to_hf.py", line 159, in package_to_hub
    _generate_config(local_path, configfile_name)
  File "/content/ml-agents/ml-agents/mlagents/utils/push_to_hf.py", line 29, in _generate_config
    with open(os.path.join(local_dir, configfile_name)) as yaml_in:
FileNotFoundError: [Errno 2] No such file or directory: 'results/Huggy/configuration.yaml'

This only needs the path to be changed from "Huggy" to "Huggy2".

Laz4rz avatar Apr 26 '24 21:04 Laz4rz

Hey there 👋 , the local dir depends on the run-id name.

There's no bug: for instance if you call your run-id = Huggytesttest the local dir will be --local-dir="./results/Huggytestest"

simoninithomas avatar May 02 '24 06:05 simoninithomas

Hey,

yes of course it is run id dependent, but for now this is just not cohere. There is no reason the --run-id to be first Huggy2 and then Huggy when saving the model.

image image

This of course is a very simple thing to fix while running the notebook. But there is simply no reason for these two not to be aligned. The point of the notebook is not to look for path correctness.

Laz4rz avatar May 02 '24 09:05 Laz4rz

Ok I see what you mean sorry for the misunderstanding, I merge your PR.

Thanks again 🤗

simoninithomas avatar Jun 10 '24 14:06 simoninithomas