Shitao commited on
Commit
519af80
1 Parent(s): cb56f08

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +4 -4
README.md CHANGED
@@ -80,10 +80,10 @@ from FlagEmbedding import FlagLLMReranker
80
  reranker = FlagLLMReranker('BAAI/bge-reranker-v2-gemma', use_bf16=True) # Setting use_bf16 to True speeds up computation with a slight performance degradation
81
 
82
  score = reranker.compute_score(['query', 'passage'])
83
- print(score) # 2.15625
84
 
85
  scores = reranker.compute_score([['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.']])
86
- print(scores) # [-0.84765625, 10.625]
87
  ```
88
 
89
  #### For LLM-based layerwise reranker
@@ -93,10 +93,10 @@ from FlagEmbedding import LayerWiseFlagLLMReranker
93
  reranker = LayerWiseFlagLLMReranker('BAAI/bge-reranker-v2-minicpm-layerwise', use_bf16=True) # Setting use_bf16 to True speeds up computation with a slight performance degradation
94
 
95
  score = reranker.compute_score(['query', 'passage'], cutoff_layers=[28]) # Adjusting 'cutoff_layers' to pick which layers are used for computing the score.
96
- print(score) # -7.03125
97
 
98
  scores = reranker.compute_score([['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.']], cutoff_layers=[28])
99
- print(scores) # [-10.0, 1.8203125]
100
  ```
101
 
102
  ### Using Huggingface transformers
 
80
  reranker = FlagLLMReranker('BAAI/bge-reranker-v2-gemma', use_bf16=True) # Setting use_bf16 to True speeds up computation with a slight performance degradation
81
 
82
  score = reranker.compute_score(['query', 'passage'])
83
+ print(score)
84
 
85
  scores = reranker.compute_score([['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.']])
86
+ print(scores)
87
  ```
88
 
89
  #### For LLM-based layerwise reranker
 
93
  reranker = LayerWiseFlagLLMReranker('BAAI/bge-reranker-v2-minicpm-layerwise', use_bf16=True) # Setting use_bf16 to True speeds up computation with a slight performance degradation
94
 
95
  score = reranker.compute_score(['query', 'passage'], cutoff_layers=[28]) # Adjusting 'cutoff_layers' to pick which layers are used for computing the score.
96
+ print(score)
97
 
98
  scores = reranker.compute_score([['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.']], cutoff_layers=[28])
99
+ print(scores)
100
  ```
101
 
102
  ### Using Huggingface transformers