Text Classification
Transformers
Safetensors
sentence-transformers
multilingual
qwen2_vl
feature-extraction
vidore
reranker
custom_code
🇪🇺 Region: EU
Instructions to use jinaai/jina-reranker-m0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jinaai/jina-reranker-m0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="jinaai/jina-reranker-m0", trust_remote_code=True)# Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("jinaai/jina-reranker-m0", trust_remote_code=True) model = AutoModel.from_pretrained("jinaai/jina-reranker-m0", trust_remote_code=True, device_map="auto") - sentence-transformers
How to use jinaai/jina-reranker-m0 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("jinaai/jina-reranker-m0", trust_remote_code=True) sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Xinference is no support?
#10
by jiatianxia - opened
python:
import json
from xinference.client import Client
with open('c:\Users\jinaai\Downloads\model.json') as fd:
model = fd.read()
replace with real xinference endpoint
endpoint = 'http://ip:9997'
client = Client(endpoint)
client.register_model(model_type="rerank", model=model, persist=False)
model.json
{
"model_name": "jina-reranker-m0",
"type": "normal",
"language": ["en", "zh"],
"model_id": "jinaai/jina-reranker-m0"
}
python import Client.py
report:
Server error: 400 - [address=0.0.0.0:36765, pid=590] Unrecognized configuration class <class 'transformers.models.qwen2_vl.configuration_qwen2_vl.Qwen2VLConfig'> for this kind of AutoModel: AutoModelForSequenceClassification.
so:Xinference is no support?