transformers icon indicating copy to clipboard operation
transformers copied to clipboard

added type hints for blip_text model

Open iamarunbrahma opened this issue 1 year ago • 4 comments

What does this PR do?

Added type hints for blip_text pytorch model as tasked in #16059

@Rocketknight1 Could you review this?

iamarunbrahma avatar Apr 27 '23 08:04 iamarunbrahma

Error logs suggest that to use pip install "black[jupyter]" but unable to understand what to do after that. @Rocketknight1 could you suggest how to fix test failures?

iamarunbrahma avatar Apr 27 '23 11:04 iamarunbrahma

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Hi @iamarunbrahma, black is a code formatting tool. After you've installed it, run make style or make fixup in the transformers directory. This should reformat your file for you and get the tests in the CI to pass.

Rocketknight1 avatar Apr 27 '23 12:04 Rocketknight1

@Rocketknight1 getting this error while running make fixup:

/bin/sh: line 3: black: command not found
/bin/sh: line 4: ruff: command not found
make: *** [Makefile:10: modified_only_fixup] Error 127

and while running make style:

make: black: No such file or directory
make: *** [Makefile:68: style] Error 127

I have installed both black and ruff

iamarunbrahma avatar Apr 27 '23 12:04 iamarunbrahma

@iamarunbrahma looks like black wasn't installed after all! The easiest way to get it is to cd to the transformers source directory you're working on and pip install .[quality]. You can also just type pip install transformers[quality] anywhere, but this may get slightly older versions of the code quality tools (it's usually fine though).

Once the tools you need are installed, make fixup or make style should work.

Rocketknight1 avatar Apr 28 '23 14:04 Rocketknight1