Instructions to use MoritzLaurer/bge-m3-zeroshot-v2.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MoritzLaurer/bge-m3-zeroshot-v2.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="MoritzLaurer/bge-m3-zeroshot-v2.0")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("MoritzLaurer/bge-m3-zeroshot-v2.0") model = AutoModelForSequenceClassification.from_pretrained("MoritzLaurer/bge-m3-zeroshot-v2.0", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
[CLS] token representation or Pooled tokens?
#8
by aarabil - opened
How is the base model used during finetuning, do you use the [CLS] hidden token representation or do you pool the tokens together somehow (e.g. averaging)?
Coming back to this question, especially since the base model is a finetuned embedding model in this case. Wondering how you adapt this model compared to a standard encoder for the nli task? Do you simply use the embedding model in the same way as the other models? If so, which separation token so you use?
I used the exact same script as for other encoder-only models like RoBERTa or DeBERTa via the HF trainer, so I assume that the trainer used the CLS token