Skip to content

Commit

Permalink
Fix error wrongly triggered on model key absence
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinGleize committed Dec 31, 2024
1 parent 03511c2 commit 496fc36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fairseq2/recipes/llama/convert_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def run(self, args: Namespace) -> int:

sys.exit(1)

if "model" not in checkpoint:
log.error("Checkpoint file {} does not contain a 'model' entry.", input_file.name) # fmt: skip
if all(key not in checkpoint for key in ["model_key", "model"]):
log.error("Checkpoint file {} does not contain a 'model_key' nor 'model' entry.", input_file.name) # fmt: skip

sys.exit(1)

Expand Down

0 comments on commit 496fc36

Please sign in to comment.