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

adapt llava pipeline to latest Transformers #1344

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Spycsh
Copy link
Member

@Spycsh Spycsh commented Feb 28, 2025

Description

OH main branch is using a old Transformers version which causes a security issue. This PR upgrades this microservice to use latest TF and use the image-text-to-text pipeline for general VLM image understanding QA tasks.

There are existing code that handle multi-image/non-image cases. However, the handling logics does not work with the new image-text-to-text task name. Furthermore, explicitly overwriting the preprocess method only works with specific TF version and is prone to version upgrade. Batching inference also cannot explain the coherence between images (e.g. What are the differences between those 2 given images). Therefore for simplicity, we decide to remove that handling of multi-image inputs but keep the non-image inputs.

  • change TF pipeline name from image-to-text to image-text-to-text
  • simplify the preprocessing logics, keep the handling when image is empty string, and remove the multi-image inference in one run
  • fix few README errors

Issues

n/a

Type of change

List the type of change like below. Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would break existing design and interface)
  • Others (enhancement, documentation, validation, etc.)

Dependencies

latest TF instead of 4.45.2 that currently used by OH

Tests

UT

- change TF pipeline name from image-to-text to image-text-to-text huggingface/transformers#34769
- simplify the preprocessing logics, keep the handling when image is empty string, and remove the multi-image inference in one run
- fix few README errors
@lvliang-intel lvliang-intel requested a review from letonghan March 1, 2025 13:07
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