Text Ranking
sentence-transformers
Safetensors
Transformers
new
text-classification
text-embeddings-inference
custom_code
Instructions to use Alibaba-NLP/gte-multilingual-reranker-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Alibaba-NLP/gte-multilingual-reranker-base with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("Alibaba-NLP/gte-multilingual-reranker-base", trust_remote_code=True) query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Transformers
How to use Alibaba-NLP/gte-multilingual-reranker-base with Transformers:
# Load model directly from transformers import AutoModelForSequenceClassification model = AutoModelForSequenceClassification.from_pretrained("Alibaba-NLP/gte-multilingual-reranker-base", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
error load model
#13
by NghiemAbe - opened
Hello, when I load the model, I have this error, can you help me fix it?
Traceback (most recent call last):
File "/home/tungnk/workings/nvn/soict/soict2024/src/dummy.py", line 100, in <module>
model = AutoModelForSequenceClassification.from_pretrained(
File "/home/tungnk/miniconda3/envs/vit5/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 559, in from_pretrained
return model_class.from_pretrained(
File "/home/tungnk/miniconda3/envs/vit5/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3792, in from_pretrained
if metadata.get("format") == "pt":
AttributeError: 'NoneType' object has no attribute 'get'
See the discussion here: https://huggingface.co/Alibaba-NLP/gte-multilingual-reranker-base/discussions/12
That discussion isn't helpful. I have the same issue.
The main branch file has been updated to fix this problem.
NghiemAbe changed discussion status to closed