littlebird13 commited on
Commit
5c76dc8
·
verified ·
1 Parent(s): ff536d3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -9
README.md CHANGED
@@ -12,15 +12,13 @@ library_name: transformers
12
 
13
  ## Highlights
14
 
15
- The Qwen3 Embedding series model is the latest proprietary model of the Qwen family, specifically designed for text embedding and ranking tasks. Building upon the dense foundational models of the Qwen3 series, it provides a comprehensive range of text embeddings and reranking models in various sizes (0.6B, 4B, and 8B). This series inherits the exceptional multilingual capabilities, long-text understanding, and reasoning skills of its foundational model. The Qwen3 Embedding series represents significant advancements in multiple text embedding and ranking tasks, including text retrieval, code retrieval, text classification, text clustering, and bitext mining.
16
 
17
  **Exceptional Versatility**: The embedding model has achieved state-of-the-art performance across a wide range of downstream application evaluations. The 8B size embedding model ranks No.1 in the MTEB multilingual leaderboard (as of May 26, 2025, score 70.58), while the reranking model excels in various text retrieval scenarios.
18
 
19
  **Comprehensive Flexibility**: The Qwen3 Embedding series offers a full spectrum of sizes (from 0.6B to 8B) for both embedding and reranking models, catering to diverse use cases that prioritize efficiency and effectiveness. Developers can seamlessly combine these two modules. Additionally, the embedding model allows for flexible vector definitions across all dimensions, and both embedding and reranking models support user-defined instructions to enhance performance for specific tasks, languages, or scenarios.
20
 
21
- **Multilingual Capability**: The Qwen3 Embedding series support over 100 languages, including various programming languages, and provides robust multilingual, cross-lingual, and code retrieval capabilities.
22
-
23
- ## Model Overview
24
 
25
  **Qwen3-Reranker-4B** has the following features:
26
 
@@ -87,11 +85,11 @@ def compute_logits(inputs, **kwargs):
87
  scores = batch_scores[:, 1].exp().tolist()
88
  return scores
89
 
90
- tokenizer = AutoTokenizer.from_pretrained("tongyi/Qwen3-Reranker-4B", padding_side='left')
91
- model = AutoModelForCausalLM.from_pretrained("tongyi/Qwen3-Reranker-4B").eval()
92
 
93
  # We recommend enabling flash_attention_2 for better acceleration and memory saving.
94
- # model = AutoModelForCausalLM.from_pretrained("tongyi/Qwen3-Reranker-4B", torch_dtype=torch.float16, attn_implementation="flash_attention_2").cuda().eval()
95
 
96
  token_false_id = tokenizer.convert_tokens_to_ids("no")
97
  token_true_id = tokenizer.convert_tokens_to_ids("yes")
@@ -180,8 +178,8 @@ def compute_logits(model, messages, sampling_params, true_token, false_token):
180
  return scores
181
 
182
  number_of_gpu = torch.cuda.device_count()
183
- tokenizer = AutoTokenizer.from_pretrained('tongyi/Qwen3-Reranker-4B')
184
- model = LLM(model='tongyi/Qwen3-Reranker-4B', tensor_parallel_size=number_of_gpu, max_model_len=10000, enable_prefix_caching=True, gpu_memory_utilization=0.8)
185
  tokenizer.padding_side = "left"
186
  tokenizer.pad_token = tokenizer.eos_token
187
  suffix = "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n"
 
12
 
13
  ## Highlights
14
 
15
+ The Qwen3 Embedding model series is the latest proprietary model of the Qwen family, specifically designed for text embedding and ranking tasks. Building upon the dense foundational models of the Qwen3 series, it provides a comprehensive range of text embeddings and reranking models in various sizes (0.6B, 4B, and 8B). This series inherits the exceptional multilingual capabilities, long-text understanding, and reasoning skills of its foundational model. The Qwen3 Embedding series represents significant advancements in multiple text embedding and ranking tasks, including text retrieval, code retrieval, text classification, text clustering, and bitext mining.
16
 
17
  **Exceptional Versatility**: The embedding model has achieved state-of-the-art performance across a wide range of downstream application evaluations. The 8B size embedding model ranks No.1 in the MTEB multilingual leaderboard (as of May 26, 2025, score 70.58), while the reranking model excels in various text retrieval scenarios.
18
 
19
  **Comprehensive Flexibility**: The Qwen3 Embedding series offers a full spectrum of sizes (from 0.6B to 8B) for both embedding and reranking models, catering to diverse use cases that prioritize efficiency and effectiveness. Developers can seamlessly combine these two modules. Additionally, the embedding model allows for flexible vector definitions across all dimensions, and both embedding and reranking models support user-defined instructions to enhance performance for specific tasks, languages, or scenarios.
20
 
21
+ **Multilingual Capability**: The Qwen3 Embedding series offer support for over 100 languages, thanks to the multilingual capabilites of Qwen3 models. This includes various programming languages, and provides robust multilingual, cross-lingual, and code retrieval capabilities.
 
 
22
 
23
  **Qwen3-Reranker-4B** has the following features:
24
 
 
85
  scores = batch_scores[:, 1].exp().tolist()
86
  return scores
87
 
88
+ tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-Reranker-4B", padding_side='left')
89
+ model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-Reranker-4B").eval()
90
 
91
  # We recommend enabling flash_attention_2 for better acceleration and memory saving.
92
+ # model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-Reranker-4B", torch_dtype=torch.float16, attn_implementation="flash_attention_2").cuda().eval()
93
 
94
  token_false_id = tokenizer.convert_tokens_to_ids("no")
95
  token_true_id = tokenizer.convert_tokens_to_ids("yes")
 
178
  return scores
179
 
180
  number_of_gpu = torch.cuda.device_count()
181
+ tokenizer = AutoTokenizer.from_pretrained('Qwen/Qwen3-Reranker-4B')
182
+ model = LLM(model='Qwen/Qwen3-Reranker-4B', tensor_parallel_size=number_of_gpu, max_model_len=10000, enable_prefix_caching=True, gpu_memory_utilization=0.8)
183
  tokenizer.padding_side = "left"
184
  tokenizer.pad_token = tokenizer.eos_token
185
  suffix = "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n"