Minami-su commited on
Commit
2906d22
1 Parent(s): fc6f804

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -0
README.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ pipeline_tag: text-generation
6
+ tags:
7
+ - chat
8
+ ---
9
+
10
+ This is the LLaMAfied version of [Qwen2-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2-0.5B-Instruct) model by Alibaba Cloud.
11
+ The original codebase can be found at: (https://github.com/hiyouga/LLaMA-Factory/blob/main/tests/llamafy_qwen.py).
12
+ I have made modifications to make it compatible with qwen2.
13
+ This model is converted with https://github.com/Minami-su/character_AI_open/tree/main/Qwen2_llamafy_Mistralfy
14
+
15
+ Usage:
16
+
17
+ ```python
18
+
19
+ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
20
+ tokenizer = AutoTokenizer.from_pretrained("Minami-su/Qwen2-0.5B-Instruct-llamafy")
21
+ model = AutoModelForCausalLM.from_pretrained("Minami-su/Qwen2-0.5B-Instruct-llamafy", torch_dtype="auto", device_map="auto")
22
+ streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
23
+
24
+ messages = [
25
+ {"role": "user", "content": "Who are you?"}
26
+ ]
27
+ inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
28
+ inputs = inputs.to("cuda")
29
+ generate_ids = model.generate(inputs,max_length=2048, streamer=streamer)
30
+
31
+ ```