Unverified Commit 22d37a9d authored by Gabriel Luiz Freitas Almeida's avatar Gabriel Luiz Freitas Almeida Committed by GitHub
Browse files

Fix deprecation warning for return_all_scores (#19217)

* Improve deprecation warning for return_all_scores

* Fix formatting
parent a357ed50
......@@ -87,7 +87,9 @@ class TextClassificationPipeline(Pipeline):
postprocess_params["_legacy"] = False
elif return_all_scores is not None:
warnings.warn(
"`return_all_scores` is now deprecated, use `top_k=1` if you want similar functionnality", UserWarning
"`return_all_scores` is now deprecated, if want a similar funcionality use `top_k=None` instead of"
" `return_all_scores=True` or `top_k=1` instead of `return_all_scores=False`.",
UserWarning,
)
if return_all_scores:
postprocess_params["top_k"] = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment