Edit model card

Пример 1

from transformers import AutoModel, AutoTokenizer, AutoModelForSequenceClassification
import torch
sigmoid_fn = torch.nn.Sigmoid()
# model = AutoModelForSequenceClassification.from_pretrained("/home/jovyan/pakorolev/ranker/deep_pavlov_mrr_0_8413")
# tokenizer = AutoTokenizer.from_pretrained("/home/jovyan/pakorolev/ranker/deep_pavlov_mrr_0_8413")

model = AutoModelForSequenceClassification.from_pretrained("PitKoro/cross-encoder-ru-msmarco-passage")
tokenizer = AutoTokenizer.from_pretrained("PitKoro/cross-encoder-ru-msmarco-passage")

text = [['привет', 'привет'],['привет', 'пока']]
tokenized = tokenizer(text, return_tensors='pt')

logits = model(**tokenized).logits
output = sigmoid_fn(logits.flatten())

print(output)

Пример 2

from sentence_transformers.cross_encoder import CrossEncoder

model = CrossEncoder("PitKoro/cross-encoder-ru-msmarco-passage", max_length=512)
text = [['привет', 'привет'],['привет', 'пока']]

output = model.predict(text)

print(output)
Downloads last month
515
Inference API
Unable to determine this model’s pipeline type. Check the docs .

Dataset used to train PitKoro/cross-encoder-ru-msmarco-passage