michaelfeil
commited on
Commit
•
3777b8d
1
Parent(s):
1e1223f
Update README.md
Browse files
README.md
CHANGED
@@ -374,8 +374,8 @@ import torch
|
|
374 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
375 |
|
376 |
tokenizer = AutoTokenizer.from_pretrained('BAAI/bge-reranker-large')
|
377 |
-
model = AutoModelForSequenceClassification.from_pretrained('BAAI/bge-reranker-
|
378 |
-
model_ort =
|
379 |
|
380 |
# Sentences we want sentence embeddings for
|
381 |
pairs = [['what is panda?', 'hi'], ['what is panda?', 'The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear or simply panda, is a bear species endemic to China.']]
|
@@ -401,7 +401,7 @@ query='what is panda?'
|
|
401 |
docs = ['The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear', "Paris is in France."]
|
402 |
|
403 |
engine = AsyncEmbeddingEngine.from_args(
|
404 |
-
EngineArgs(model_name_or_path = "BAAI/bge-
|
405 |
))
|
406 |
|
407 |
async def main():
|
|
|
374 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
375 |
|
376 |
tokenizer = AutoTokenizer.from_pretrained('BAAI/bge-reranker-large')
|
377 |
+
model = AutoModelForSequenceClassification.from_pretrained('BAAI/bge-reranker-base')
|
378 |
+
model_ort = ORTModelForSequenceClassification.from_pretrained('BAAI/bge-reranker-base', file_name="onnx/model.onnx")
|
379 |
|
380 |
# Sentences we want sentence embeddings for
|
381 |
pairs = [['what is panda?', 'hi'], ['what is panda?', 'The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear or simply panda, is a bear species endemic to China.']]
|
|
|
401 |
docs = ['The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear', "Paris is in France."]
|
402 |
|
403 |
engine = AsyncEmbeddingEngine.from_args(
|
404 |
+
EngineArgs(model_name_or_path = "BAAI/bge-reranker-base", device="cpu", engine="optimum" # or engine="torch"
|
405 |
))
|
406 |
|
407 |
async def main():
|