Closed jawj closed 4 months ago
The recent update introduces support for custom user-defined models within the Rust project, specifically focusing on tokenizer files and reranking models. It adds new structs, enums, and methods to handle user-defined text embedding and reranking models, enabling users to load raw .onnx
files with additional configuration parameters. Furthermore, a new RerankerModel
variant and expanded public entity declarations enhance the flexibility and functionality of the text processing capabilities.
File(s) | Change Summary |
---|---|
src/common.rs |
Added TokenizerFiles struct to manage tokenizer files. |
src/lib.rs |
Expanded public entities, including TokenizerFiles and UserDefinedRerankingModel . |
src/models/reranking.rs |
Introduced JINARerankerV1TurboEn variant to RerankerModel and updated reranker_model_list function. |
src/reranking.rs |
Added new structs and methods for initializing and using user-defined reranking models. |
src/tests.rs |
Added entities for user-defined reranking models and updated tests. |
src/text_embedding.rs |
Integrated TokenizerFiles into UserDefinedEmbeddingModel struct. |
Cargo.toml |
Added George MacKerron as an author. |
README.md |
Documented new features for loading user-defined text embedding and reranking models. |
sequenceDiagram
participant User
participant TextRerank
participant UserDefinedRerankingModel
participant RerankInitOptionsUserDefined
User->>TextRerank: try_new_from_user_defined(model, options)
activate TextRerank
TextRerank->>UserDefinedRerankingModel: Load model files
TextRerank->>RerankInitOptionsUserDefined: Initialize options
TextRerank-->>User: User-defined reranking model instance created
deactivate TextRerank
sequenceDiagram
participant User
participant TextEmbedding
participant UserDefinedEmbeddingModel
participant InitOptionsUserDefined
User->>TextEmbedding: try_new_from_user_defined(model, options)
activate TextEmbedding
TextEmbedding->>UserDefinedEmbeddingModel: Load model files
TextEmbedding->>InitOptionsUserDefined: Initialize options
TextEmbedding-->>User: User-defined embedding model instance created
deactivate TextEmbedding
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@Anush008 I'm not clear why GitHub thinks there's a conflict here: the start of the incoming change is identical to the existing code that it claims conflicts.
Please take a look and then perhaps you can resolve this in favour of the incoming code?
Also, please feel free to add yourself to the authors list in the Cargo.toml
file.
:tada: This issue has been resolved in version 3.9.0 :tada:
The release is available on:
v3.9.0
Your semantic-release bot :package::rocket:
I just realised, the README example looks a little terrifying but also cool. LOL 😆
As previously discussed in #75, these changes allow a user-defined reranking model, similar to user-defined embedding models.
Summary by CodeRabbit
New Features
UserDefinedRerankingModel
for custom reranking models.local_model!
macro to define and load user-defined models.Documentation
.onnx
files for embedding and reranking models.Chores
Cargo.toml
file.