SAVRN
Search Contact SAVRN

Open-weight model · Feature extraction

bge-base-en-v1.5

by Joshua Xenova/bge-base-en-v1.5

https://huggingface.co/BAAI/bge-base-en-v1.5 with ONNX weights to be compatible with Transformers.js.

Parameters
Context512
Weights1.4 GB
Licensemit
AccessOpen weights
Monthly Downloads2.5M

Model Card

By Joshua, published under mit, revision 4d6cd88e18e5.

https://huggingface.co/BAAI/bge-base-en-v1.5 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: You can then use the model to compute embeddings, as follows: You can also use the model for retrieval. For example: Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Read Joshua's full model card

https://huggingface.co/BAAI/bge-base-en-v1.5 with ONNX weights to be compatible with Transformers.js.

Usage (Transformers.js)

If you haven't already, you can install the Transformers.js JavaScript library from NPM using:

npm i @huggingface/transformers

You can then use the model to compute embeddings, as follows:

import { pipeline } from '@huggingface/transformers';

// Create a feature-extraction pipeline
const extractor = await pipeline('feature-extraction', 'Xenova/bge-base-en-v1.5');

// Compute sentence embeddings
const texts = ['Hello world.', 'Example sentence.'];
const embeddings = await extractor(texts, { pooling: 'mean', normalize: true });
console.log(embeddings);
// Tensor {
//   dims: [ 2, 768 ],
//   type: 'float32',
//   data: Float32Array(1536) [ 0.019079938530921936, 0.041718777269124985, ... ],
//   size: 1536
// }

console.log(embeddings.tolist()); // Convert embeddings to a JavaScript list
// [
//   [ 0.019079938530921936, 0.041718777269124985, 0.037672195583581924, ... ],
//   [ 0.020936904475092888, 0.020080938935279846, -0.00787576474249363, ... ]
// ]

You can also use the model for retrieval. For example:

import { pipeline, cos_sim } from '@huggingface/transformers';

// Create a feature-extraction pipeline
const extractor = await pipeline('feature-extraction', 'Xenova/bge-base-en-v1.5');

// List of documents you want to embed
const texts = [
    'Hello world.',
    'The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear or simply panda, is a bear species endemic to China.',
    'I love pandas so much!',
];

// Compute sentence embeddings
const embeddings = await extractor(texts, { pooling: 'mean', normalize: true });

// Prepend recommended query instruction for retrieval.
const query_prefix = 'Represent this sentence for searching relevant passages: '
const query = query_prefix + 'What is a panda?';
const query_embeddings = await extractor(query, { pooling: 'mean', normalize: true });

// Sort by cosine similarity score
const scores = embeddings.tolist().map(
    (embedding, i) => ({
        id: i,
        score: cos_sim(query_embeddings.data, embedding),
        text: texts[i],
    })
).sort((a, b) => b.score - a.score);
console.log(scores);
// [
//   { id: 1, score: 0.7787772374597298, text: 'The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear or simply panda, is a bear species endemic to China.' },
//   { id: 2, score: 0.7071589521880506, text: 'I love pandas so much!' },
//   { id: 0, score: 0.4252782730390429, text: 'Hello world.' }
// ]

Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Configuration

Architecture
BertModel
Context length (tokens)
512
Layers
12
Hidden size
768
Feed-forward size
3,072
Attention heads
12
Vocabulary size
30,522
Model type
bert

Identity and Version

Repository
Xenova/bge-base-en-v1.5
Publisher
Joshua
Task
Feature extraction
Modality
Text
Library
transformers.js
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
4d6cd88e18e51a5e020c2c305726d76ada9c03cf
First published
2023-09-13
Last updated
2025-07-29

Files and Weights

16 files, 1.4 GB in total. The weights are 8 files totalling 1.4 GB in onnx.

Weights8 files · 1.4 GB
Configuration3 files · 1.5 KB
Tokenizer3 files · 943.3 KB
Documentation1 file · 3.1 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
onnx/model.onnxWeights435.8 MB 9bc579acdba2
onnx/model_bnb4.onnxWeights143.9 MB ea48bd872b39
onnx/model_fp16.onnxWeights218.1 MB 6bf19e68279b
onnx/model_int8.onnxWeights109.6 MB b83dfe249580
onnx/model_q4.onnxWeights149.2 MB 6add7418be60
onnx/model_q4f16.onnxWeights96.0 MB 57fb23ae669a
onnx/model_quantized.onnxWeights110.1 MB c9729cc84cbd
onnx/model_uint8.onnxWeights109.6 MB def0f5c7871a
config.jsonConfiguration717 B
quantize_config.jsonConfiguration674 B
special_tokens_map.jsonConfiguration125 B
README.mdDocumentation3.1 KB
.gitattributesRepository1.5 KB
tokenizer.jsonTokenizer711.4 KB
tokenizer_config.jsonTokenizer366 B
vocab.txtTokenizer231.5 KB

License and Download

License
mit
Access
Open weights, no gate
Download size
1.4 GB
Download from Joshua

Released by Joshua through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published1.4 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About bge-base-en-v1.5

Can I use bge-base-en-v1.5 commercially?

Yes. bge-base-en-v1.5 is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

What is bge-base-en-v1.5's context length?

512 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Model · Feature extraction

all-MiniLM-L6-v2

Joshua

https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: You can then use the model to compute embeddings like this: You can convert this Tensor to a nested JavaScript array using.tolist(): Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Open weights apache-2.0 512 tokens transformers.js

Model · Feature extraction

clap-htsat-unfused

LAION eV

The abstract of the paper states that: You can use this model for zero shot audio classification or extracting audio and/or textual features. You can also get the audio and text embeddings using ClapModel If you are using this model for your work, please consider citing the original paper

Open weights apache-2.0 514 tokens transformers

Model · Feature extraction

wavlm-large

Microsoft

The large model pretrained on 16kHz sampled speech audio. When using the model, make sure that your speech input is also sampled at 16kHz. Note: This model does not have a tokenizer as it was pretrained on audio alone. In order to use this model speech recognition, a tokenizer should be created and the model should be fine-tuned on labeled text data. Check out this blog for more in-detail explanation of how to fine-tune the model. - 60,000 hours of Libri-Light - 10,000 hours of GigaSpeech - 24,000 hours of VoxPopuli Authors: Sanyuan Chen, Chengyi Wang, Zhengyang Chen, Yu Wu, Shujie Liu, Zhuo Chen, Jinyu Li, Naoyuki Kanda, Takuya Yoshioka, Xiong Xiao, Jian Wu, Long Zhou, Shuo Ren, Yanmin…

Open weights transformers

For more details please refer to our Github: FlagEmbedding. If you are looking for a model that supports more languages, longer texts, and other retrieval methods, you can try using bge-m3. FlagEmbedding focuses on retrieval-augmented LLMs, consisting of the following projects currently: - 1/30/2024: Release BGE-M3, a new member to BGE model series! M3 stands for Multi-linguality (100+ languages), Multi-granularities (input length up to 8192), Multi-Functionality (unification of dense, lexical, multi-vec/colbert retrieval). It is the first embedding model which supports all three retrieval methods, achieving new SOTA on multi-lingual (MIRACL) and cross-lingual (MKQA) benchmarks. Technical…

Open weights mit 512 tokens sentence-transformers

Model · Feature extraction

specter2_base

Ai2

SPECTER2 is the successor to SPECTER and is capable of generating task specific embeddings for scientific tasks when paired with adapters. This is the base model to be used along with the adapters. Given the combination of title and abstract of a scientific paper or a short texual query, the model can be used to generate effective embeddings to be used in downstream applications. Note:For general embedding purposes, please use allenai/specter2. To get the best performance on a downstream task type please load the associated adapter with the base model as in the example below. Model usage updated to be compatible with latest versions of transformers and adapters (newly released update to…

Open weights apache-2.0 512 tokens transformers