Skip to content

Commit

Permalink
Uncomment log prob params check
Browse files Browse the repository at this point in the history
Signed-off-by: Martín Santillán Cooper <[email protected]>
  • Loading branch information
martinscooper committed Feb 11, 2025
1 parent c451c57 commit 2548490
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/unitxt/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -2251,13 +2251,13 @@ def _set_logprobs_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
"top_n_tokens": user_return_options.get("top_n_tokens", 5),
}

# for key, value in logprobs_return_options.items():
# if key in user_return_options and user_return_options[key] != value:
# raise ValueError(
# f"'{key}={user_return_options[key]}' is not supported for the 'infer_log_probs' "
# f"method of {self.__class__.__name__}. For obtaining the logprobs of generated tokens "
# f"please use '{key}={value}'."
# )
for key, value in logprobs_return_options.items():
if key in user_return_options and user_return_options[key] != value:
raise ValueError(
f"'{key}={user_return_options[key]}' is not supported for the 'infer_log_probs' "
f"method of {self.__class__.__name__}. For obtaining the logprobs of generated tokens "
f"please use '{key}={value}'."
)

return {
**params,
Expand Down

0 comments on commit 2548490

Please sign in to comment.