Instructions to use clarin-knext/herbert-large-msmarco with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use clarin-knext/herbert-large-msmarco with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="clarin-knext/herbert-large-msmarco")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("clarin-knext/herbert-large-msmarco") model = AutoModelForSequenceClassification.from_pretrained("clarin-knext/herbert-large-msmarco") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
How to use:
With sentence transformers:
from sentence_transformers import CrossEncoder
model_path = "clarin-knext/herbert-large-msmarco"
model = CrossEncoder(model_path, max_length=512)
scores = model.predict([('Query', 'Paragraph1'), ('Query', 'Paragraph2') , ('Query', 'Paragraph3')])
With transformers:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_path = "clarin-knext/herbert-large-msmarco"
model = AutoModelForSequenceClassification.from_pretrained(model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path)
features = tokenizer(['Jakie miasto jest stolica Polski?', 'Stolicą Polski jest Warszawa.'], padding=True, truncation=True, return_tensors="pt")
model.eval()
with torch.no_grad():
scores = model(**features).logits
print(scores)
- Downloads last month
- 3