Text Generation
Transformers
Safetensors
Chinese
English
qwen
conversational
custom_code
yuyijiong commited on
Commit
d484906
1 Parent(s): 0912888

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -2
README.md CHANGED
@@ -5,5 +5,10 @@ language:
5
  - en
6
  ---
7
  * 将Qwen模型的NTK插值方法替换为Yarn,同时修改插值的程度,实现模型在更长文本长度(大于16k)下的正常对话能力。
8
- * 目前仅提供代码,模型权重与原Qwen模型相同。未来可能会发布微调的权重
9
- * 使用时请务必设置 config.use_logn_attn=False、config.use_dynamic_ntk=True,否则模型能力会受影响。
 
 
 
 
 
 
5
  - en
6
  ---
7
  * 将Qwen模型的NTK插值方法替换为Yarn,同时修改插值的程度,实现模型在更长文本长度(大于16k)下的正常对话能力。
8
+ * 目前仅提供 modeling_qwen.py 代码,用此py文件替换原Qwen模型的modeling_qwen.py即可,其它使用方法不变。模型权重与原Qwen模型相同。
9
+ * 未来可能会发布微调的权重。
10
+ * 使用时请务必设置 config.use_logn_attn=False、config.use_dynamic_ntk=True,否则模型能力会受影响。
11
+ ```python
12
+ config=AutoConfig.from_pretrained("Qwen/Qwen-14B-Chat", trust_remote_code=True,use_dynamic_ntk=True,use_logn_attn=False,torch_dtype=torch.bfloat16)
13
+ model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen-14B-Chat", device_map="auto", trust_remote_code=True,config=config)
14
+ ```