--- license: apache-2.0 datasets: - unicamp-dl/mmarco language: - ru library_name: sentence-transformers --- ## Пример 1 ```python 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 ```python 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) ```