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

Fix docstrings for TF BLIP #22618

Merged
merged 5 commits into from
Apr 12, 2023
Merged

Fix docstrings for TF BLIP #22618

merged 5 commits into from
Apr 12, 2023

Conversation

Rocketknight1
Copy link
Member

Some of the docstrings were still a bit PyTorchy, this is fixed now! (cc @ydshieh)

@innat
Copy link

innat commented Apr 7, 2023

@Rocketknight1 Thanks for adding tf-blip.
PS. in case you're interested to contribute keras-team/keras-hub#941

@ydshieh
Copy link
Collaborator

ydshieh commented Apr 11, 2023

@Rocketknight1 I tried to re-run the CI, but it still fails. Could you push an empty commit to trigger it maybe?

@Rocketknight1 Rocketknight1 force-pushed the fix_tf_blip_docstrings branch from 64f9c32 to 7c326c9 Compare April 11, 2023 13:41
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Apr 11, 2023

The documentation is not available anymore as the PR was closed or merged.

@Rocketknight1
Copy link
Member Author

@ydshieh tests are passing now! Can you approve the PR?

@ydshieh
Copy link
Collaborator

ydshieh commented Apr 11, 2023

@Rocketknight1 When I run the doctest

python3 -m pytest -v --make-reports doc_tests_gpu --doctest-modules src/transformers/models/blip/modeling_tf_blip.py::transformers.models.blip.modeling_tf_blip.TFBlipForConditionalGeneration.generate -sv --doctest-continue-on-failure --doctest-glob="*.mdx"

I got

Expected:
    two cats are laying on a couch
Got:
    two cats sleeping on a couch

@ydshieh
Copy link
Collaborator

ydshieh commented Apr 11, 2023

Also, the changes are not just docstrings. After looking at the changes, I am wondering why we don't have CI failures (i.e. the usual testing).

It turns out that we do have some failures
https://github.com/huggingface/transformers/actions/runs/4653835201/jobs/8235101265

@Rocketknight1 Do you want to verify/fix those in this same PR? (probably already fixed as CircleCI is green?)

@Rocketknight1
Copy link
Member Author

Oh, that's very odd - I wonder why it's not visible in the CI? I'll take a look!

@ydshieh
Copy link
Collaborator

ydshieh commented Apr 11, 2023

Thank you @Rocketknight1 . I am also confused why CircleCI is green but failed on daily CI.

@Rocketknight1
Copy link
Member Author

@ydshieh tests should pass now! The cause was some expected values in the tests being wrong. I copied the right ones from the torch tests and now everything is passing locally, so hopefully the CI will agree.

@Rocketknight1
Copy link
Member Author

The doctests are weird, though - I think some of them were broken in PyTorch too. Working on it!

@ydshieh
Copy link
Collaborator

ydshieh commented Apr 11, 2023

Thanks @Rocketknight1 I will double check. But do you figure out (some of) tests pass on CircleCI but fails on daily CI - the pt<->tf equivalence tests also run on CircleCI. We should see they fail on it (as they fail on daily CI).

@ydshieh
Copy link
Collaborator

ydshieh commented Apr 12, 2023

For the doctest, we still get

Expected:
    two cats are laying on a couch
Got:
    two cats sleeping on a couch

for TFBlipForConditionalGeneration.generate.

Regarding the modeling tests - all tests pass now 🥳

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @Rocketknight1 on this. A doctest value still needs to be updated I think.

Also wondering why we don't see test failure on CircleCI previously. If you know, please let me know 🙏 .

@Rocketknight1
Copy link
Member Author

@ydshieh should be resolved now!

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

Thank you @Rocketknight1 again, our 2 cute cats can finally sleep well now.

@Rocketknight1 Rocketknight1 merged commit 50f82e1 into main Apr 12, 2023
@Rocketknight1 Rocketknight1 deleted the fix_tf_blip_docstrings branch April 12, 2023 16:46
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
* Fix docstrings for TFBLIP

* Fix missing line in TF port!

* Use values from torch tests now other bugs fixed

* Use values from torch tests now other bugs fixed

* Fix doctest string
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.

4 participants