RichardErkhov commited on
Commit
99e7817
ยท
verified ยท
1 Parent(s): 2bce818

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +116 -0
README.md ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ Qwen2-7B-Instruct-Response-Exp - bnb 8bits
11
+ - Model creator: https://huggingface.co/alibaba-pai/
12
+ - Original model: https://huggingface.co/alibaba-pai/Qwen2-7B-Instruct-Response-Exp/
13
+
14
+
15
+
16
+
17
+ Original model description:
18
+ ## ๐Ÿ“– Introduction
19
+
20
+ **Qwen2-7B-Instruct-Response-Exp** is a powerful large language model that can automatically expand datasets and annotations like self-instruct.
21
+
22
+ We fine-tuned **Qwen2-7B-Instruct** to obtain **Qwen2-7B-Instruct-Response-Exp**.
23
+ We sampled the dataset from OpenHermes and the LCCD dataset, ensuring a balanced task distribution. For training set annotations, we used Qwen-max with incorporated our handwritten examples as in-context prompts.
24
+
25
+ #### Example Input
26
+ >\#\#\# Instruction
27
+ >
28
+ >Here are some concepts: car, driving, travel Can you make a sentence with these concepts?
29
+ >
30
+ >\#\#\# Response
31
+ >
32
+ >Of course you can! Here is a sentence: "We drove the car and started an unforgettable journey.
33
+ >
34
+ >\#\#\# Instruction
35
+ >
36
+ >Why does the sun rise in the east every day?
37
+ >
38
+ >\#\#\# Response
39
+ >
40
+ >
41
+ >The sun rises in the east every day because of the direction of the earth's rotation and geographical features. The earth rotates from west to east, so an observer on the surface of the earth will see the sun rise from the eastern horizon, pass through the sky, and finally set on the western horizon. Specifically, the earth's rotation axis refers to an imaginary axis that passes through the north and south poles of the earth, and the earth rotates from west to east around this axis. Because of this rotation, any place on the earth will experience day and night. When a place rotates to the side facing the sun, it will usher in daytime; when it rotates to the side facing away from the sun, it will usher in night. Since the direction of the earth's rotation is from west to east, the sun appears to rise from the east and set in the west. This phenomenon is a direct result of the earth's rotation, not the movement of the sun itself.
42
+ >
43
+ >\#\#\# Instruction
44
+ >
45
+ #### Example Output
46
+ >\#\#\# Instruction
47
+ >
48
+ >Here are some concepts: books, learning, knowledge Can you make a sentence with these concepts?
49
+ >
50
+ >\#\#\# Response
51
+ >
52
+ >Of course you can! Here is a sentence that contains these concepts: By reading books, we can continue to learn and enrich our knowledge.
53
+
54
+
55
+
56
+ ## ๐Ÿš€ Quick Start
57
+
58
+ Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
59
+
60
+ ```python
61
+ from transformers import AutoModelForCausalLM, AutoTokenizer
62
+ device = "cuda" # the device to load the model onto
63
+
64
+ model = AutoModelForCausalLM.from_pretrained(
65
+ "alibaba-pai/Qwen2-7B-Instruct-Response-Exp",
66
+ torch_dtype="auto",
67
+ device_map="auto"
68
+ )
69
+ tokenizer = AutoTokenizer.from_pretrained("alibaba-pai/Qwen2-7B-Instruct-Response-Exp")
70
+
71
+ prompt = "Give me a short introduction to large language model."
72
+ messages = [
73
+ {"role": "user", "content": prompt}
74
+ ]
75
+ text = tokenizer.apply_chat_template(
76
+ messages,
77
+ tokenize=False,
78
+ add_generation_prompt=True
79
+ )
80
+ model_inputs = tokenizer([text], return_tensors="pt").to(device)
81
+
82
+ generated_ids = model.generate(
83
+ model_inputs.input_ids,
84
+ max_new_tokens=2048๏ผŒ
85
+ eos_token_id=151645๏ผŒ
86
+ )
87
+ generated_ids = [
88
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
89
+ ]
90
+
91
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
92
+ ```
93
+
94
+ ## ๐Ÿ” Evaluation
95
+
96
+ | | Diversity | Length | Complexity | Factuality |
97
+ |-----------------|-----------|--------|------------|------------|
98
+ | Self-Instruct | 9.6 | 15.8 | 0.32 | 5.0 |
99
+ | Qwen2-7B-Instruct-Response-Exp | 17.2 | 26.3 | 4.97 | 4.9 |
100
+
101
+ ## ๐Ÿ“œ Citation
102
+
103
+ If you find our work helpful, please cite it!
104
+
105
+ ```
106
+ @misc{data-augmentation-family,
107
+ title={Building a Family of Data Augmentation Models for Low-cost LLM Fine-tuning on the Cloud},
108
+ author={Yuanhao Yue and Chengyu Wang and Jun Huang and Peng Wang},
109
+ year={2024},
110
+ eprint={2412.04871},
111
+ archivePrefix={arXiv},
112
+ primaryClass={cs.CL},
113
+ url={https://arxiv.org/abs/2412.04871},
114
+ }
115
+ ```
116
+