Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show_progress_bar as parameter on predict and predict_prob #429

Merged
merged 4 commits into from
Oct 17, 2023
Merged

show_progress_bar as parameter on predict and predict_prob #429

merged 4 commits into from
Oct 17, 2023

Conversation

davidsbatista
Copy link
Contributor

@davidsbatista davidsbatista commented Oct 17, 2023

  • I want to deploy Setfit in production without having the progress bar shown when any of the predict methods is called, it seems there's no explicit way to do this unless changing the logging level which sentence-transformer
    uses to decide on the show_progress_bar boolean value

  • Adding show_progress_bar as a parameter on SetFitModel.predict and SetFitModel.predict_prob methods

@davidsbatista davidsbatista changed the title show_progress_bar as parameter on predict and predict_prob methods) show_progress_bar as parameter on predict and predict_prob Oct 17, 2023
@davidsbatista
Copy link
Contributor Author

The PR is now failing due to the message from flake8

src/setfit/exporters/onnx.py:156:8: E721 do not compare types, for exact checks use is / is not, for instance checks use isinstance()

which was not something my PR introduced, I can nevertheless fix it

    # If the datatype of the model is double we need to cast the outputs
    # from the setfit model to doubles for compatibility inside of ONNX.
    if type(dtype) == onnxconverter_common.data_types.DoubleTensorType:
        sklearn_model = Pipeline([("castdouble", CastTransformer(dtype=np.double)), ("head", model_head)])
    else:
        sklearn_model = model_head

David S. Batista and others added 2 commits October 17, 2023 17:36
@tomaarsen
Copy link
Member

I'll tackle the unrelated quality check in a separate PR. Thanks for this!

@davidsbatista
Copy link
Contributor Author

OK, if you want I can then merge/sync this with main, just let me know when that separate quality check issue is solved/merged

@tomaarsen
Copy link
Member

No worries, I'll handle it from here. I'll merge this as soon as the tests pass (which they should), despite the quality failure.

@tomaarsen tomaarsen merged commit 23e20f5 into huggingface:main Oct 17, 2023
@tomaarsen
Copy link
Member

Thanks again!

@davidsbatista
Copy link
Contributor Author

happy to have contributed :)

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.

2 participants