ibrahimkettaneh commited on
Commit
62cc1f4
·
verified ·
1 Parent(s): eb3dc83

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +92 -3
README.md CHANGED
@@ -19,13 +19,102 @@ library_name: transformers
19
 
20
  # Credits goes to all those who have contributed to the community, in this case, specifically: [huihui-ai](https://huggingface.co/huihui-ai)/[QwQ-32B-Preview-abliterated](https://huggingface.co/huihui-ai/QwQ-32B-Preview-abliterated)
21
 
 
 
 
 
 
 
 
 
 
22
 
23
  This is an uncensored version of [Qwen/QwQ-32B-Preview](https://huggingface.co/Qwen/QwQ-32B-Preview) created with abliteration (see [remove-refusals-with-transformers](https://github.com/Sumandora/remove-refusals-with-transformers) to know more about it).
 
24
  This is a crude, proof-of-concept implementation to remove refusals from an LLM model without using TransformerLens.
25
 
26
- ## ollama
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- You can use [huihui_ai/qwq-abliterated](https://ollama.com/huihui_ai/qwq-abliterated) directly,
29
  ```
30
- ollama run huihui_ai/qwq-abliterated
 
 
 
 
 
 
 
 
 
 
 
 
31
  ```
 
19
 
20
  # Credits goes to all those who have contributed to the community, in this case, specifically: [huihui-ai](https://huggingface.co/huihui-ai)/[QwQ-32B-Preview-abliterated](https://huggingface.co/huihui-ai/QwQ-32B-Preview-abliterated)
21
 
22
+ # Benchmark
23
+
24
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6635be30b0a5f86a2af4b6a0/O4FesNygEcWvX3OBxgrM2.png)
25
+
26
+ Source: [🐺🐦‍⬛ LLM Comparison/Test: 25 SOTA LLMs (including QwQ) through 59 MMLU-Pro CS benchmark runs](https://huggingface.co/blog/wolfram/llm-comparison-test-2024-12-04)
27
+
28
+ Credits go to for their helpful and informative benchmark: [Wolfram Ravenwolf](https://huggingface.co/wolfram)
29
+
30
+ # Context
31
 
32
  This is an uncensored version of [Qwen/QwQ-32B-Preview](https://huggingface.co/Qwen/QwQ-32B-Preview) created with abliteration (see [remove-refusals-with-transformers](https://github.com/Sumandora/remove-refusals-with-transformers) to know more about it).
33
+
34
  This is a crude, proof-of-concept implementation to remove refusals from an LLM model without using TransformerLens.
35
 
36
+ # QwQ-32B-Preview
37
+
38
+ ## Introduction
39
+
40
+ **QwQ-32B-Preview** is an experimental research model developed by the Qwen Team, focused on advancing AI reasoning capabilities. As a preview release, it demonstrates promising analytical abilities while having several important limitations:
41
+
42
+ 1. **Language Mixing and Code-Switching**: The model may mix languages or switch between them unexpectedly, affecting response clarity.
43
+ 2. **Recursive Reasoning Loops**: The model may enter circular reasoning patterns, leading to lengthy responses without a conclusive answer.
44
+ 3. **Safety and Ethical Considerations**: The model requires enhanced safety measures to ensure reliable and secure performance, and users should exercise caution when deploying it.
45
+ 4. **Performance and Benchmark Limitations**: The model excels in math and coding but has room for improvement in other areas, such as common sense reasoning and nuanced language understanding.
46
+
47
+ **Specification**:
48
+ - Type: Causal Language Models
49
+ - Training Stage: Pretraining & Post-training
50
+ - Architecture: transformers with RoPE, SwiGLU, RMSNorm, and Attention QKV bias
51
+ - Number of Parameters: 32.5B
52
+ - Number of Paramaters (Non-Embedding): 31.0B
53
+ - Number of Layers: 64
54
+ - Number of Attention Heads (GQA): 40 for Q and 8 for KV
55
+ - Context Length: Full 32,768 tokens
56
+
57
+ For more details, please refer to our [blog](https://qwenlm.github.io/blog/qwq-32b-preview/). You can also check Qwen2.5 [GitHub](https://github.com/QwenLM/Qwen2.5), and [Documentation](https://qwen.readthedocs.io/en/latest/).
58
+
59
+ ## Requirements
60
+
61
+ The code of Qwen2.5 has been in the latest Hugging face `transformers` and we advise you to use the latest version of `transformers`.
62
+
63
+ With `transformers<4.37.0`, you will encounter the following error:
64
+ ```
65
+ KeyError: 'qwen2'
66
+ ```
67
+
68
+ ## Quickstart
69
+
70
+ Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
71
+
72
+ ```python
73
+ from transformers import AutoModelForCausalLM, AutoTokenizer
74
+ model_name = "Qwen/QwQ-32B-Preview"
75
+ model = AutoModelForCausalLM.from_pretrained(
76
+ model_name,
77
+ torch_dtype="auto",
78
+ device_map="auto"
79
+ )
80
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
81
+ prompt = "How many r in strawberry."
82
+ messages = [
83
+ {"role": "system", "content": "You are a helpful and harmless assistant. You are Qwen developed by Alibaba. You should think step-by-step."},
84
+ {"role": "user", "content": prompt}
85
+ ]
86
+ text = tokenizer.apply_chat_template(
87
+ messages,
88
+ tokenize=False,
89
+ add_generation_prompt=True
90
+ )
91
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
92
+ generated_ids = model.generate(
93
+ **model_inputs,
94
+ max_new_tokens=512
95
+ )
96
+ generated_ids = [
97
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
98
+ ]
99
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
100
+ ```
101
+
102
+ ## Citation
103
+
104
+ If you find our work helpful, feel free to give us a cite.
105
 
 
106
  ```
107
+ @misc{qwq-32b-preview,
108
+ title = {QwQ: Reflect Deeply on the Boundaries of the Unknown},
109
+ url = {https://qwenlm.github.io/blog/qwq-32b-preview/},
110
+ author = {Qwen Team},
111
+ month = {November},
112
+ year = {2024}
113
+ }
114
+ @article{qwen2,
115
+ title={Qwen2 Technical Report},
116
+ author={An Yang and Baosong Yang and Binyuan Hui and Bo Zheng and Bowen Yu and Chang Zhou and Chengpeng Li and Chengyuan Li and Dayiheng Liu and Fei Huang and Guanting Dong and Haoran Wei and Huan Lin and Jialong Tang and Jialin Wang and Jian Yang and Jianhong Tu and Jianwei Zhang and Jianxin Ma and Jin Xu and Jingren Zhou and Jinze Bai and Jinzheng He and Junyang Lin and Kai Dang and Keming Lu and Keqin Chen and Kexin Yang and Mei Li and Mingfeng Xue and Na Ni and Pei Zhang and Peng Wang and Ru Peng and Rui Men and Ruize Gao and Runji Lin and Shijie Wang and Shuai Bai and Sinan Tan and Tianhang Zhu and Tianhao Li and Tianyu Liu and Wenbin Ge and Xiaodong Deng and Xiaohuan Zhou and Xingzhang Ren and Xinyu Zhang and Xipin Wei and Xuancheng Ren and Yang Fan and Yang Yao and Yichang Zhang and Yu Wan and Yunfei Chu and Yuqiong Liu and Zeyu Cui and Zhenru Zhang and Zhihao Fan},
117
+ journal={arXiv preprint arXiv:2407.10671},
118
+ year={2024}
119
+ }
120
  ```