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 pil import in VLM #1019

Merged
merged 1 commit into from
Nov 22, 2024
Merged

Conversation

eaidova
Copy link
Collaborator

@eaidova eaidova commented Nov 22, 2024

What does this PR do?

make PIL optional for running optimum-intel. This dependency is not listed in requirements and used only for type checking, for avoid inconvenience for nlp part only users, it is better make its import optional. For cases, where it is really used, it should be already installed and checked by source libraries like transformers and diffusers

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@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.

Copy link
Collaborator

@nikita-savelyevv nikita-savelyevv left a comment

Choose a reason for hiding this comment

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

I've examined a dependency tree after pip install .[openvino] and see that Pillow gets installed. It is a dependency of nncf, which in turn is installed under [openvino] option. Please see the tree below.

I'm curious, which scenario have you considered for this fix?

nncf==2.14.0
  jsonschema==4.23.0
    attrs==24.2.0
    jsonschema-specifications==2024.10.1
      referencing==0.35.1
        attrs==24.2.0
        rpds-py==0.21.0
    referencing==0.35.1
      attrs==24.2.0
      rpds-py==0.21.0
    rpds-py==0.21.0
  jstyleson==0.0.2
  natsort==8.4.0
  networkx==3.2.1
  ninja==1.11.1.1
  numpy==2.0.2
  openvino-telemetry==2024.5.0
  packaging==24.2
  pandas==2.2.3
    numpy==2.0.2
    python-dateutil==2.9.0.post0
      six==1.16.0
    pytz==2024.2
    tzdata==2024.2
  psutil==6.1.0
  pydot==2.0.0
    pyparsing==3.2.0
  pymoo==0.6.1.3
    alive-progress==3.2.0
      about-time==4.2.1
      grapheme==0.6.0
    autograd==1.7.0
      numpy==2.0.2
    cma==3.2.2
      numpy==2.0.2
    Deprecated==1.2.15
      wrapt==1.17.0
    dill==0.3.8
    matplotlib==3.9.2
      contourpy==1.3.0
        numpy==2.0.2
      cycler==0.12.1
      fonttools==4.55.0
      importlib_resources==6.4.5
        zipp==3.21.0
      kiwisolver==1.4.7
      numpy==2.0.2
      packaging==24.2
      pillow==11.0.0

@eaidova
Copy link
Collaborator Author

eaidova commented Nov 22, 2024

on my end it failed in openvino notebooks, where optimum-intel and ov/nncv was installed separately without usage extra

@AlexKoff88 AlexKoff88 merged commit cf5b951 into huggingface:main Nov 22, 2024
19 of 24 checks passed
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