Skip to content

Conversation

ezelanza
Copy link

@ezelanza ezelanza commented Sep 4, 2025

This PR updates the Gemma3 notebook to use OpenVINO GenAI instead of the transformers library.

Changes Made

  • Replaced transformers with OpenVINO GenAI
  • Updated model loading to use OpenVINO GenAI pipeline
  • Modified gradio helper to work with OpenVINO GenAI streaming capabilities

Files Changed

  • notebooks/gemma3/gemma3.ipynb - Main notebook updates
  • notebooks/gemma3/gradio_helper.py - Gradio helper updates
  • notebooks/gemma3/README.md - Documentation updates

Testing

  • Notebook runs successfully with OpenVINO GenAI
  • Gradio interface works with streaming
  • Image processing functions correctly
  • All dependencies are properly handled

- Replace transformers library with openvino_genai for better performance
- Update model loading to use OpenVINO GenAI pipeline
- Modify gradio helper to work with OpenVINO GenAI streaming
- Simplify inference code and remove unnecessary dependencies
- Improve image processing for OpenVINO GenAI format
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

review-notebook-app bot commented Sep 26, 2025

View / edit / reply to this conversation on ReviewNB

aleksandr-mokrov commented on 2025-09-26T11:39:23Z
----------------------------------------------------------------

Line #6.    %pip install -q "git+https://github.com/huggingface/[email protected]" --extra-index-url https://download.pytorch.org/whl/cpu

We can update it the transformers. The 4.55.4 version has the support of gemma3


Copy link

review-notebook-app bot commented Sep 26, 2025

View / edit / reply to this conversation on ReviewNB

aleksandr-mokrov commented on 2025-09-26T11:39:23Z
----------------------------------------------------------------

Line #3.    

Comment it please


Copy link

review-notebook-app bot commented Sep 26, 2025

View / edit / reply to this conversation on ReviewNB

aleksandr-mokrov commented on 2025-09-26T11:39:24Z
----------------------------------------------------------------

Line #5.    #if not model_export_dir.exists():

Uncomment please


Copy link

review-notebook-app bot commented Sep 26, 2025

View / edit / reply to this conversation on ReviewNB

aleksandr-mokrov commented on 2025-09-26T11:39:25Z
----------------------------------------------------------------

Line #13.    image = load_image(image_file)

It doesn't work if you don't have a downloaded image.


@ezelanza ezelanza force-pushed the update-gemma3-openvino-genai-clean branch from c7b029b to 0e8ad58 Compare October 1, 2025 12:56
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.

1 participant