-
Notifications
You must be signed in to change notification settings - Fork 310
Register Qwen3 Embedding Presets to Kerashub #2455
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @laxmareddyp, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates new Qwen3 text embedding model presets into Keras Hub. This expansion provides users with access to different scales of Qwen3 embedding models, each offering varying parameter counts and flexible embedding dimensions, thereby enhancing the platform's capabilities for diverse natural language processing tasks. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds three new presets for Qwen3 embedding models to qwen3_presets.py. While the structure of the new presets is consistent with existing ones in the file, the pull request is missing corresponding unit tests to validate that these new presets can be loaded and function correctly. The contribution guidelines for this repository state that testing is a mandatory part of any change. I have added a comment with a suggestion on how to add a test for the new presets.
| "qwen3_embedding_0.6b_en": { | ||
| "metadata": { | ||
| "description": ( | ||
| "This text embedding model features a 32k context length and " | ||
| "offers flexible, user-defined embedding dimensions that can " | ||
| "range from 32 to 1024." | ||
| ), | ||
| "params": 595776512, | ||
| "path": "qwen3", | ||
| }, | ||
| "kaggle_handle": "kaggle://keras/qwen-3-embedding/keras/qwen3_embedding_0.6b_en/1", | ||
| }, | ||
| "qwen3_embedding_4b_en": { | ||
| "metadata": { | ||
| "description": ( | ||
| "This text embedding model features a 32k context length and " | ||
| "offers flexible, user-defined embedding dimensions that can " | ||
| "range from 32 to 2560." | ||
| ), | ||
| "params": 4021774336, | ||
| "path": "qwen3", | ||
| }, | ||
| "kaggle_handle": "kaggle://keras/qwen-3-embedding/keras/qwen3_embedding_4b_en/1", | ||
| }, | ||
| "qwen3_embedding_8b_en": { | ||
| "metadata": { | ||
| "description": ( | ||
| "This text embedding model features a 32k context length and " | ||
| "offers flexible, user-defined embedding dimensions that can " | ||
| "range from 32 to 4096." | ||
| ), | ||
| "params": 8188515328, | ||
| "path": "qwen3", | ||
| }, | ||
| "kaggle_handle": "kaggle://keras/qwen-3-embedding/keras/qwen3_embedding_8b_en/1", | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new presets for Qwen3 embedding models have been added, but there are no corresponding tests to verify they work correctly. According to the repository's style guide, testing is a non-negotiable part of every contribution, and presets should be tested to confirm they can be loaded.1
Please add a new test case to keras_hub/src/models/qwen3/qwen3_backbone_test.py to validate at least the smallest of the new presets, qwen3_embedding_0.6b_en, using self.run_preset_test().
For example:
@pytest.mark.large
def test_embedding_preset(self):
self.run_preset_test(
cls=Qwen3Backbone,
preset="qwen3_embedding_0.6b_en",
input_data=self.input_data,
# The output shape might need adjustment based on the preset's hidden_dim.
expected_output_shape=(2, 5, 1024),
)Style Guide References
Footnotes
-
The style guide states that testing is a non-negotiable part of every contribution and that presets must be tested to ensure they can be loaded correctly using
self.run_preset_test(). ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test case will cover above presets as well. no need of test case here.
Description of the change
Reference
Colab Notebook
Checklist