Minami-su commited on
Commit
d1e6054
1 Parent(s): 2105703

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +16 -16
README.md CHANGED
@@ -15,7 +15,7 @@ tags:
15
  - qwen1.5
16
  - qwen2
17
  ---
18
- This is the Mistral version of [Qwen1.5-0.5B-Chat](https://huggingface.co/Qwen/Qwen1.5-0.5B-Chat) model by Alibaba Cloud.
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/mistral_qwen2.py
@@ -46,8 +46,8 @@ Usage:
46
  ```python
47
 
48
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
49
- tokenizer = AutoTokenizer.from_pretrained("Minami-su/Qwen1.5-0.5B-Chat_mistral")
50
- model = AutoModelForCausalLM.from_pretrained("Minami-su/Qwen1.5-0.5B-Chat_mistral", torch_dtype="auto", device_map="auto")
51
  streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
52
 
53
  messages = [
@@ -55,31 +55,31 @@ messages = [
55
  ]
56
  inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
57
  inputs = inputs.to("cuda")
58
- generate_ids = model.generate(inputs,max_length=2048, streamer=streamer)
59
 
60
  ```
61
 
62
  ## Test
63
  load in 4bit
64
  ```
65
- hf-causal (pretrained=Qwen1.5-0.5B-Chat), limit: None, provide_description: False, num_fewshot: 0, batch_size: 32
66
  | Task |Version| Metric |Value | |Stderr|
67
  |-------------|------:|--------|-----:|---|-----:|
68
- |arc_challenge| 0|acc |0.2389|± |0.0125|
69
- | | |acc_norm|0.2688|± |0.0130|
70
- |truthfulqa_mc| 1|mc1 |0.2534|± |0.0152|
71
- | | |mc2 |0.4322|± |0.0151|
72
- |winogrande | 0|acc |0.5564|± |0.0140|
73
  ```
74
  load in 4bit
75
  ```
76
- hf-causal (pretrained=Qwen1.5-0.5B-Chat_mistral), limit: None, provide_description: False, num_fewshot: 0, batch_size: 32
77
  | Task |Version| Metric |Value | |Stderr|
78
  |-------------|------:|--------|-----:|---|-----:|
79
- |arc_challenge| 0|acc |0.2398|± |0.0125|
80
- | | |acc_norm|0.2705|± |0.0130|
81
- |truthfulqa_mc| 1|mc1 |0.2534|± |0.0152|
82
- | | |mc2 |0.4322|± |0.0151|
83
- |winogrande | 0|acc |0.5549|± |0.0140|
84
  ```
85
  ```
 
15
  - qwen1.5
16
  - qwen2
17
  ---
18
+ This is the Mistral version of [Qwen1.5-7B-Chat](https://huggingface.co/Qwen/Qwen1.5-7B-Chat) model by Alibaba Cloud.
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/mistral_qwen2.py
 
46
  ```python
47
 
48
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
49
+ tokenizer = AutoTokenizer.from_pretrained("Minami-su/Qwen1.5-7B-Chat_mistral")
50
+ model = AutoModelForCausalLM.from_pretrained("Minami-su/Qwen1.5-7B-Chat_mistral", torch_dtype="auto", device_map="auto")
51
  streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
52
 
53
  messages = [
 
55
  ]
56
  inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
57
  inputs = inputs.to("cuda")
58
+ generate_ids = model.generate(inputs,max_length=32768, streamer=streamer)
59
 
60
  ```
61
 
62
  ## Test
63
  load in 4bit
64
  ```
65
+ hf-causal (pretrained=Qwen1.5-7B-Chat), limit: None, provide_description: False, num_fewshot: 0, batch_size: 8
66
  | Task |Version| Metric |Value | |Stderr|
67
  |-------------|------:|--------|-----:|---|-----:|
68
+ |arc_challenge| 0|acc |0.4155|± |0.0144|
69
+ | | |acc_norm|0.4480|± |0.0145|
70
+ |truthfulqa_mc| 1|mc1 |0.3513|± |0.0167|
71
+ | | |mc2 |0.5165|± |0.0159|
72
+ |winogrande | 0|acc |0.6330|± |0.0135|
73
  ```
74
  load in 4bit
75
  ```
76
+ hf-causal (pretrained=Qwen1.5-7B-Chat_mistral), limit: None, provide_description: False, num_fewshot: 0, batch_size: 16
77
  | Task |Version| Metric |Value | |Stderr|
78
  |-------------|------:|--------|-----:|---|-----:|
79
+ |arc_challenge| 0|acc |0.4172|± |0.0144|
80
+ | | |acc_norm|0.4480|± |0.0145|
81
+ |truthfulqa_mc| 1|mc1 |0.3488|± |0.0167|
82
+ | | |mc2 |0.5161|± |0.0159|
83
+ |winogrande | 0|acc |0.6306|± |0.0136|
84
  ```
85
  ```