Skip to content

Example for running local Qwen3-Embedding model with Transformers.js#3

Open
johntostring wants to merge 1 commit intoENATION-UK:mainfrom
johntostring:dev-embedding
Open

Example for running local Qwen3-Embedding model with Transformers.js#3
johntostring wants to merge 1 commit intoENATION-UK:mainfrom
johntostring:dev-embedding

Conversation

@johntostring
Copy link

Sorry, I can't keep working on this due to time constraints. This PR is just an example for your reference.

The Qwen3 Embedding model (see here) was recently open-sourced, and the ONNX community already has a converted .onnx model available.

To demonstrate this quickly, we only need the smallest model file. So when cloning the model repository, we’ll exclude large files first.

  1. Ensure git-lfs is installed:
git lfs install
  1. Clone the repository without large files:
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/onnx-community/Qwen3-Embedding-0.6B-ONNX
  1. Pull the necessary large files (this example needs the smallest model.onnx):
git lfs pull --include="tokenizer.json"
git lfs pull --include="onnx/model.onnx"
  1. Edit src/main/model.ts and update env.localModelPath to your local model path.

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