Minami-su commited on
Commit
19941b2
1 Parent(s): 189e011

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -0
README.md CHANGED
@@ -19,8 +19,11 @@ This is the LLaMAfied version of [Qwen1.5-7B-Chat](https://huggingface.co/Qwen/Q
19
  The original codebase can be found at: (https://github.com/hiyouga/LLaMA-Factory/blob/main/tests/llamafy_qwen.py).
20
  I have made modifications to make it compatible with qwen1.5.
21
  This model is converted with https://github.com/Minami-su/character_AI_open/blob/main/llamafy_qwen_v2.py
 
22
  Usage:
 
23
  ```python
 
24
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
25
  tokenizer = AutoTokenizer.from_pretrained("Minami-su/Qwen1.5-7B-Chat_llamafy")
26
  model = AutoModelForCausalLM.from_pretrained("Minami-su/Qwen1.5-7B-Chat_llamafy", torch_dtype="auto", device_map="auto")
@@ -32,7 +35,9 @@ messages = [
32
  inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
33
  inputs = inputs.to("cuda")
34
  generate_ids = model.generate(inputs,max_length=2048, streamer=streamer)
 
35
  ```
 
36
  ## Test
37
  load in 4bit
38
  ```
 
19
  The original codebase can be found at: (https://github.com/hiyouga/LLaMA-Factory/blob/main/tests/llamafy_qwen.py).
20
  I have made modifications to make it compatible with qwen1.5.
21
  This model is converted with https://github.com/Minami-su/character_AI_open/blob/main/llamafy_qwen_v2.py
22
+
23
  Usage:
24
+
25
  ```python
26
+
27
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
28
  tokenizer = AutoTokenizer.from_pretrained("Minami-su/Qwen1.5-7B-Chat_llamafy")
29
  model = AutoModelForCausalLM.from_pretrained("Minami-su/Qwen1.5-7B-Chat_llamafy", torch_dtype="auto", device_map="auto")
 
35
  inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
36
  inputs = inputs.to("cuda")
37
  generate_ids = model.generate(inputs,max_length=2048, streamer=streamer)
38
+
39
  ```
40
+
41
  ## Test
42
  load in 4bit
43
  ```