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

Refactor TFP call to just sigmoid() #29641

Merged
merged 2 commits into from Mar 13, 2024
Merged

Refactor TFP call to just sigmoid() #29641

merged 2 commits into from Mar 13, 2024

Conversation

Rocketknight1
Copy link
Member

@Rocketknight1 Rocketknight1 commented Mar 13, 2024

We're seeing issues caused by Tensorflow Probability + Keras 3 incompatibilities. Annoyingly, these are being thrown even when people are trying to use unrelated Torch models, as long as they have TF / TFP installed!

The underlying cause is that we import TFP in one of our pipeline files if it's present, and this file is run when pipeline is imported, even if the user is using an entirely different pipeline/framework. I removed the import entirely - it was only used to get the probabilities of a Bernoulli distribution given input logits, but this is just the sigmoid function, so I replaced the whole thing with a single call to sigmoid() instead.

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Much better 🧘 Thanks!

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Rocketknight1 Rocketknight1 merged commit 31d0115 into main Mar 13, 2024
18 checks passed
@Rocketknight1 Rocketknight1 deleted the remove_tfp_dependency branch March 13, 2024 17:51
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.

None yet

3 participants