Skip to content

attribute ValueError in llama3 models export #1517

Description

@YunchaoYang

Describe the bug:

The export of llama3 models is broken under this version 0.8.1.

ERROR: fairseq2 - Command failed due to an unexpected error. See logged stack trace for details and file a bug report to the corresponding author.
Traceback (most recent call last):
fairseq2/models/utils/hg_export.py", line 69, in main
_run()

fairseq2/models/utils/hg_export.py", line 107, in _run
export_command.run(args.model, args.save_dir) # save_dir is Path

fairseq2/models/utils/hg_export.py", line 286, in run
self._hg_saver(tmp_save_dir, hg_state_dict, hg_config)

fairseq2/models/hg/converter.py", line 178, in save_hugging_face_model
raise ValueError(
ValueError: transformers.LlamaConfig does not have an attribute named rope_theta.

Describe how to reproduce:
Steps to reproduce the behavior. Ideally attach a minimal code sample to reproduce the described issue.

Describe the expected behavior:
A clear and concise description of what you expected to happen.

Environment:
At the very least, specify the versions of fairseq2, PyTorch, Python, and CUDA along with your operating system and, if relevant, GPU model.

Additional Context:
Add any other context about the bug here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions