Skip to content

Conversation

@asharma-coursera
Copy link
Contributor

I was running the comet compare model for reference free model, and was getting error. Upon debugging this appeared like a bug to me, because the checks for reference model was already there.
Command i used
comet-compare -s src.ps -t hyp1.hi hyp2.hi --model Unbabel/wmt22-cometkiwi-da
Error
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/bin/comet-compare", line 8, in
sys.exit(compare_command())
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/comet/cli/compare.py", line 501, in compare_command
if references is not None:
^^^^^^^^^^
UnboundLocalError: cannot access local variable 'references' where it is not associated with a value

Fix compare method for reference free models
@asharma-coursera
Copy link
Contributor Author

@ricardorei please review

@ricardorei ricardorei merged commit 49c348d into Unbabel:master May 21, 2025
@asharma-coursera asharma-coursera deleted the patch-1 branch May 22, 2025 04:37
@asharma-coursera asharma-coursera mentioned this pull request Jul 25, 2025
"{} requires -r/--references or -d/--sacrebleu_dataset.".format(cfg.model)
)

references = cfg.references if cfg.references is not None else None

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

references = cfg.references or None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I'd refactor if I make another PR here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants