Files
candle/candle-examples/examples/gte-qwen
Yin Guobing 349c3e806a Support embedding model gte-Qwen1.5-7B-instruct (#2190)
* Support embedding model gte-Qwen1.5-7B-instruct

This is a text embedding model based on Qwen2. They share same
model architecture except the last MLP module. This commit brings in
minimal modification of the old Qwen2 implementation to support both
models.

An example is provided, and had been verified according to the official
PyTorch implementation.

* Avoid doing the 'last-token filtering' based on the absence of attention mask.

---------

Co-authored-by: Laurent <laurent.mazare@gmail.com>
2024-05-16 21:34:10 +02:00
..

gte-Qwen1.5-7B-instruct

gte-Qwen1.5-7B-instruct is a variant of the GTE embedding model family.

Running the example

Automatically download the model from the HuggingFace hub:

$ cargo run --example gte-qwen --release

or, load the model from a local directory:

cargo run --example gte-qwen --release --features cuda -- --local-repo /path/to/gte_Qwen1.5-7B-instruct/