Views
No views yet
### InstructionHere are some concepts: car, driving, travel Can you make a sentence with these concepts?### ResponseOf course you can! Here is a sentence: "We drove the car and started an unforgettable journey.### InstructionWhy does the sun rise in the east every day?### ResponseThe 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.### Instruction
### InstructionHere are some concepts: books, learning, knowledge Can you make a sentence with these concepts?### ResponseOf course you can! Here is a sentence that contains these concepts: By reading books, we can continue to learn and enrich our knowledge.
apply_chat_template to show you how to load the tokenizer and model and how to generate contents.1from transformers import AutoModelForCausalLM, AutoTokenizer
2device = "cuda" # the device to load the model onto
3
4model = AutoModelForCausalLM.from_pretrained(
5 "alibaba-pai/Qwen2-7B-Instruct-Response-Exp",
6 torch_dtype="auto",
7 device_map="auto"
8)
9tokenizer = AutoTokenizer.from_pretrained("alibaba-pai/Qwen2-7B-Instruct-Response-Exp")
10
11prompt = "Give me a short introduction to large language model."
12messages = [
13 {"role": "user", "content": prompt}
14]
15text = tokenizer.apply_chat_template(
16 messages,
17 tokenize=False,
18 add_generation_prompt=True
19)
20model_inputs = tokenizer([text], return_tensors="pt").to(device)
21
22generated_ids = model.generate(
23 model_inputs.input_ids,
24 max_new_tokens=2048,
25 eos_token_id=151645,
26)
27generated_ids = [
28 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
29]
30
31response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]| Diversity | Length | Complexity | Factuality | |
|---|---|---|---|---|
| Self-Instruct | 9.6 | 15.8 | 0.32 | 5.0 |
| Qwen2-7B-Instruct-Response-Exp | 17.2 | 26.3 | 4.97 | 4.9 |
@misc{data-augmentation-family,
title={Building a Family of Data Augmentation Models for Low-cost LLM Fine-tuning on the Cloud},
author={Yuanhao Yue and Chengyu Wang and Jun Huang and Peng Wang},
year={2024},
eprint={2412.04871},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2412.04871},
}