feihu.hf commited on
Commit
098145f
1 Parent(s): 83c0546

update README & config.json

Browse files
Files changed (2) hide show
  1. README.md +23 -1
  2. config.json +1 -1
README.md CHANGED
@@ -34,7 +34,8 @@ Qwen2.5-Coder is the latest series of Code-Specific Qwen large language models (
34
  - Number of Paramaters (Non-Embedding): 1.31B
35
  - Number of Layers: 28
36
  - Number of Attention Heads (GQA): 12 for Q and 2 for KV
37
- - Context Length: Full 32,768 tokens
 
38
 
39
  For more details, please refer to our [blog](https://qwenlm.github.io/blog/qwen2.5-coder/), [GitHub](https://github.com/QwenLM/Qwen2.5-Coder), and [Documentation](https://qwen.readthedocs.io/en/latest/).
40
 
@@ -86,6 +87,27 @@ generated_ids = [
86
  response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
87
  ```
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
 
90
  ## Evaluation & Performance
91
 
 
34
  - Number of Paramaters (Non-Embedding): 1.31B
35
  - Number of Layers: 28
36
  - Number of Attention Heads (GQA): 12 for Q and 2 for KV
37
+ - Context Length: Full 131,072 tokens
38
+ - Please refer to [this section](#processing-long-texts) for detailed instructions on how to deploy Qwen2.5 for handling long texts.
39
 
40
  For more details, please refer to our [blog](https://qwenlm.github.io/blog/qwen2.5-coder/), [GitHub](https://github.com/QwenLM/Qwen2.5-Coder), and [Documentation](https://qwen.readthedocs.io/en/latest/).
41
 
 
87
  response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
88
  ```
89
 
90
+ ### Processing Long Texts
91
+
92
+ The current `config.json` is set for context length up to 32,768 tokens.
93
+ To handle extensive inputs exceeding 32,768 tokens, we utilize [YaRN](https://arxiv.org/abs/2309.00071), a technique for enhancing model length extrapolation, ensuring optimal performance on lengthy texts.
94
+
95
+ For supported frameworks, you could add the following to `config.json` to enable YaRN:
96
+ ```json
97
+ {
98
+ ...,
99
+ "rope_scaling": {
100
+ "factor": 4.0,
101
+ "original_max_position_embeddings": 32768,
102
+ "type": "yarn"
103
+ }
104
+ }
105
+ ```
106
+
107
+ For deployment, we recommend using vLLM.
108
+ Please refer to our [Documentation](https://qwen.readthedocs.io/en/latest/deployment/vllm.html) for usage if you are not familar with vLLM.
109
+ Presently, vLLM only supports static YARN, which means the scaling factor remains constant regardless of input length, **potentially impacting performance on shorter texts**.
110
+ We advise adding the `rope_scaling` configuration only when processing long contexts is required.
111
 
112
  ## Evaluation & Performance
113
 
config.json CHANGED
@@ -17,7 +17,7 @@
17
  "num_key_value_heads": 2,
18
  "rms_norm_eps": 1e-06,
19
  "rope_theta": 1000000.0,
20
- "sliding_window": 32768,
21
  "tie_word_embeddings": true,
22
  "torch_dtype": "bfloat16",
23
  "transformers_version": "4.44.0",
 
17
  "num_key_value_heads": 2,
18
  "rms_norm_eps": 1e-06,
19
  "rope_theta": 1000000.0,
20
+ "sliding_window": 131072,
21
  "tie_word_embeddings": true,
22
  "torch_dtype": "bfloat16",
23
  "transformers_version": "4.44.0",