kingoflolz / mesh-transformer-jax

Model parallel transformers in JAX and Haiku
Apache License 2.0
6.29k stars 892 forks source link

Can't write config of converted hf weights to gs bucket #130

Closed kevinpl07 closed 3 years ago

kevinpl07 commented 3 years ago

I'm trying to convert my slim weights to the hf pytorch weights with a gs bucket as output_path and it crashes when writing the json config:

python3 to_hf_weights.py --input_ckpt gs://mybucket/gptj_question_slim/step_501 --config ./configs/6B_roto_256.json --output_path gs://mybucket/hf_slim/ --cpu
Traceback (most recent call last):
  File "to_hf_weights.py", line 498, in <module>
    save_config_to_hf_format(params, torch_dtype, output_path)
  File "to_hf_weights.py", line 457, in save_config_to_hf_format
    with open(output_path / "config.json", "w") as `file:`
FileNotFoundError: [Errno 2] No such file or directory: 'gs://mybucket/hf_slim/config.json'

The pytorch_model.bin file in the same folder has been written correctly, so the path is correct.

Any ideas?

Ontopic commented 3 years ago

Not behind terminal so can't check, but no / after folder caused me nightmares before.

kingoflolz commented 3 years ago

See #131 (Thanks @ablacklama )