potion-retrieval-32M-tfjs

Transformers.js-compatible ONNX re-export of minishlab/potion-retrieval-32M.

The official ONNX export uses a flat input_ids [num_tokens] + offsets [batch] interface that transformers.js cannot feed. This rebuild wraps the same embedding table (embedding_bag.weight, 63091x512, fp32) in a standard encoder interface:

  • Inputs: input_ids [batch, seq] (int64), attention_mask [batch, seq] (int64)
  • Output: last_hidden_state [batch, 1, 512] (masked mean-pooled)
  • The tokenizer ships with its special-token post-processor removed, matching native model2vec pooling (embeddings verified numerically identical to StaticModel.from_pretrained("minishlab/potion-retrieval-32M")).

Usage with transformers.js (e.g. Smart Connections / Smart Environment):

import { pipeline } from '@huggingface/transformers';
const p = await pipeline('feature-extraction', 'mikhailmedical/potion-retrieval-32M-tfjs', { dtype: 'fp32' });
const out = await p(texts, { pooling: 'mean', normalize: true });

MIT license, inherited from the upstream model.

Downloads last month
16
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mikhailmedical/potion-retrieval-32M-tfjs

Quantized
(2)
this model