Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/muse/evaluation/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def compute_cometkiwi(
try:
model_path = download_model("Unbabel/wmt22-cometkiwi-da")
LOADED_METRICS["cometkiwi"] = load_from_checkpoint(model_path)
except KeyError as e: # download_model catches all exceptions and re-raises as KeyError
except (
KeyError
) as e: # download_model catches all exceptions and re-raises as KeyError
Comment on lines +123 to +125
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this odd formatting was introduced solely for the in-line comment, it would be better to move it within the except block

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this changed was introduced by the ruff pre-commit hook, this is a reminder that you should look at all changes proposed by pre-commit hooks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Assuming this was caused by ruff, given that this line was otherwise not changed, how did this by pass both the pre-commit hooks and GitHub Actions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Assuming this was caused by ruff, given that this line was otherwise not changed, how did this by pass both the pre-commit hooks and GitHub Actions?

I was wondering that too. This change was indeed caused by ruff (uv run ruff format). Without modifying it, the CI of this PR failed. But how did it pass in the first place...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you have the pre-commit hooks set up locally? It sounds like it didn't run on that commit somehow.

msg = (
"Authentication required for CometKiwi model. "
"Please:\n"
Expand All @@ -139,6 +141,6 @@ def compute_cometkiwi(
# Predict returns a Prediction object; access the first score
model_output = model.predict(data, batch_size=1, gpus=gpus)
# The Prediction object can be indexed to get individual scores
score = model_output[0]
score = model_output[0][0]

return score
Loading