From 98a780ea18fcf893f4094e44dac11d1680b0141e Mon Sep 17 00:00:00 2001 From: ai-modelscope Date: Thu, 5 Jun 2025 20:57:10 +0800 Subject: [PATCH] Delete special_tokens_map.json --- README.md | 17 +++++++++-------- added_tokens.json | 24 ------------------------ special_tokens_map.json | 31 ------------------------------- 3 files changed, 9 insertions(+), 63 deletions(-) delete mode 100644 added_tokens.json delete mode 100644 special_tokens_map.json diff --git a/README.md b/README.md index 6716382..b8420c0 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,13 @@ library_name: transformers ## Highlights -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. +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. **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. **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. -**Multilingual Capability**: The Qwen3 Embedding series support over 100 languages, including various programming languages, and provides robust multilingual, cross-lingual, and code retrieval capabilities. - -## Model Overview +**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. **Qwen3-Embedding-8B** has the following features: @@ -43,7 +41,10 @@ For more details, including benchmark evaluation, hardware requirements, and inf | Text Reranking | [Qwen3-Reranker-4B](https://huggingface.co/Qwen/Qwen3-Reranker-4B) | 4B | 36 | 32K | - | - | Yes | | Text Reranking | [Qwen3-Reranker-8B](https://huggingface.co/Qwen/Qwen3-Reranker-8B) | 8B | 36 | 32K | - | - | Yes | -> **Note**:: `MRL Support` indicates whether the embedding model supports custom dimensions for the final embedding. `Instruct Aware` notes whether the embedding or reranking model supports customizing the input instruction according to different tasks. +> **Note**: +> - `MRL Support` indicates whether the embedding model supports custom dimensions for the final embedding. +> - `Instruct Aware` notes whether the embedding or reranking model supports customizing the input instruction according to different tasks. +> - Our evaluation indicates that, for most downstream tasks, using instructions (instruct) typically yields an improvement of 1% to 5% compared to not using them. Therefore, we recommend that developers create tailored instructions specific to their tasks and scenarios. In multilingual contexts, we also advise users to write their instructions in English, as most instructions utilized during the model training process were originally written in English. ## Usage @@ -100,11 +101,11 @@ documents = [ ] input_texts = queries + documents -tokenizer = AutoTokenizer.from_pretrained('tongyi/Qwen3-Embedding-8B', padding_side='left') -model = AutoModel.from_pretrained('tongyi/Qwen3-Embedding-8B') +tokenizer = AutoTokenizer.from_pretrained('Qwen/Qwen3-Embedding-8B', padding_side='left') +model = AutoModel.from_pretrained('Qwen/Qwen3-Embedding-8B') # We recommend enabling flash_attention_2 for better acceleration and memory saving. -# model = AutoModel.from_pretrained('tongyi/Qwen3-Embedding-8B', attn_implementation="flash_attention_2", torch_dtype=torch.float16).cuda() +# model = AutoModel.from_pretrained('Qwen/Qwen3-Embedding-8B', attn_implementation="flash_attention_2", torch_dtype=torch.float16).cuda() eod_id = tokenizer.convert_tokens_to_ids("<|endoftext|>") max_length = 8192 diff --git a/added_tokens.json b/added_tokens.json deleted file mode 100644 index 482ced4..0000000 --- a/added_tokens.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "": 151658, - "": 151657, - "<|box_end|>": 151649, - "<|box_start|>": 151648, - "<|endoftext|>": 151643, - "<|file_sep|>": 151664, - "<|fim_middle|>": 151660, - "<|fim_pad|>": 151662, - "<|fim_prefix|>": 151659, - "<|fim_suffix|>": 151661, - "<|im_end|>": 151645, - "<|im_start|>": 151644, - "<|image_pad|>": 151655, - "<|object_ref_end|>": 151647, - "<|object_ref_start|>": 151646, - "<|quad_end|>": 151651, - "<|quad_start|>": 151650, - "<|repo_name|>": 151663, - "<|video_pad|>": 151656, - "<|vision_end|>": 151653, - "<|vision_pad|>": 151654, - "<|vision_start|>": 151652 -} diff --git a/special_tokens_map.json b/special_tokens_map.json deleted file mode 100644 index ac23c0a..0000000 --- a/special_tokens_map.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "additional_special_tokens": [ - "<|im_start|>", - "<|im_end|>", - "<|object_ref_start|>", - "<|object_ref_end|>", - "<|box_start|>", - "<|box_end|>", - "<|quad_start|>", - "<|quad_end|>", - "<|vision_start|>", - "<|vision_end|>", - "<|vision_pad|>", - "<|image_pad|>", - "<|video_pad|>" - ], - "eos_token": { - "content": "<|im_end|>", - "lstrip": false, - "normalized": false, - "rstrip": false, - "single_word": false - }, - "pad_token": { - "content": "<|endoftext|>", - "lstrip": false, - "normalized": false, - "rstrip": false, - "single_word": false - } -}