hiyouga commited on
Commit
064c439
1 Parent(s): e9354b6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +43 -0
README.md CHANGED
@@ -3,4 +3,47 @@ license: other
3
  license_name: qwen
4
  license_link: >-
5
  https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT
 
 
 
 
 
 
 
 
6
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  license_name: qwen
4
  license_link: >-
5
  https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT
6
+ language:
7
+ - en
8
+ - zh
9
+ library_name: transformers
10
+ pipeline_tag: text-generation
11
+ tags:
12
+ - llama
13
+ - qwen
14
  ---
15
+
16
+ This is the LLaMAfied version of [Qwen-14B-Chat](https://huggingface.co/Qwen/Qwen-14B-Chat) model by Alibaba Cloud.
17
+
18
+ This model is converted with https://github.com/hiyouga/LLaMA-Factory/blob/main/tests/llamafy_qwen.py
19
+
20
+ You may use this model for fine-tuning in downstream tasks, we recommend using our efficient fine-tuning toolkit. https://github.com/hiyouga/LLaMA-Factory
21
+
22
+ - **Developed by:** Alibaba Cloud.
23
+ - **Language(s) (NLP):** Chinese/English
24
+ - **License:** [Tongyi Qianwen License](https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT)
25
+
26
+ Usage:
27
+
28
+ ```python
29
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
30
+
31
+ tokenizer = AutoTokenizer.from_pretrained("hiyouga/Qwen-14B-Chat-LLaMAfied")
32
+ model = AutoModelForCausalLM.from_pretrained("hiyouga/Qwen-14B-Chat-LLaMAfied").cuda()
33
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
34
+
35
+ query = (
36
+ "<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n"
37
+ "<|im_start|>user\nWho are you?<|im_end|>\n"
38
+ "<|im_start|>assistant\n"
39
+ )
40
+ inputs = tokenizer([query], return_tensors="pt")
41
+ inputs = inputs.to("cuda")
42
+ generate_ids = model.generate(**inputs, eos_token_id=[151643, 151645], max_new_tokens=256, streamer=streamer)
43
+ ```
44
+
45
+ You could also alternatively launch a CLI demo by using the script in [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory)
46
+
47
+ ```bash
48
+ python src/cli_demo.py --template qwen --model_name_or_path hiyouga/Qwen-14B-Chat-LLaMAfied
49
+ ```