求助帖--大模型04期Function Call实践作业 #389

Open
opened 2024-11-20 11:33:20 +08:00 by 11252177484cs · 1 comment

【进阶】使用function call数据测试微调大模型,提升大模型functioncall能力,
1、已经下载了数据集,function-calling-small_aliyun_openapi_V2.csv, 修改第一行为instuction,input ,output. 附图1
2、下载了配置文件llama3_8b_instruct_qlora_alpaca_e3_copyllama3_8b_instruct_qlora_alpaca_e3_copy,修改了相关配置,主要是大模型和数据所在目录.附图 2
3、运行命令:NPROC_PER_NODE=4 xtuner train /code/llama3_8b_instruct_qlora_alpaca_e3_copy.py --work-dir /userhome/llama3-8b-ft/function-calling --deepspeed deepspeed_zero3_offload ,报错。附图3
判断可能是因为数据文件的问题
请问:1、.csv文件是否要转化为.json文件。2、如何进行转换?
相关截图如下:
1、
image
2、
image
3、
image
image

【进阶】使用function call数据测试微调大模型,提升大模型functioncall能力, 1、已经下载了数据集,function-calling-small_aliyun_openapi_V2.csv, 修改第一行为instuction,input ,output. 附图1 2、下载了配置文件llama3_8b_instruct_qlora_alpaca_e3_copyllama3_8b_instruct_qlora_alpaca_e3_copy,修改了相关配置,主要是大模型和数据所在目录.附图 2 3、运行命令:NPROC_PER_NODE=4 xtuner train /code/llama3_8b_instruct_qlora_alpaca_e3_copy.py --work-dir /userhome/llama3-8b-ft/function-calling --deepspeed deepspeed_zero3_offload ,报错。附图3 判断可能是因为数据文件的问题 请问:1、.csv文件是否要转化为.json文件。2、如何进行转换? 相关截图如下: 1、 <img width="415" alt="image" src="/attachments/0102fa30-613f-4cdb-8b17-722d3a693b00"> 2、 <img width="415" alt="image" src="/attachments/1ae9800d-bc12-4a16-b9d7-95bf31a1f0e3"> 3、 <img width="415" alt="image" src="/attachments/f1d13f98-8cc6-4de1-8e4c-6a6ea5815cc5"> <img width="415" alt="image" src="/attachments/7d5386ac-5421-4161-b98e-3df02814f7fe">

需要改成jsonl的格式,一行一个json是一条数据,类似这样

{"instruction_zh": "给出三个保持健康的小贴士。", "input_zh": "", "output_zh": "1. 饮食要均衡且富有营养:确保你的餐食包含各种水果、蔬菜、瘦肉、全谷物和健康脂肪。这有助于为身体提供必要的营养,使其发挥最佳功能,并有助于预防慢性疾病。2. 经常参加体育锻炼:锻炼对于保持强壮的骨骼、肌肉和心血管健康至关重要。每周至少要进行150分钟的中等有氧运动或75分钟的剧烈运动。3. 获得足够的睡眠:获得足够的高质量睡眠对身体和心理健康至关重要。它有助于调节情绪,提高认知功能,并支持健康的生长和免疫功能。每晚睡眠目标为7-9小时。", "instruction": "Give three tips for staying healthy.", "input": "", "output": "1. Eat a balanced and nutritious diet: Make sure your meals are inclusive of a variety of fruits and vegetables, lean protein, whole grains, and healthy fats. This helps to provide your body with the essential nutrients to function at its best and can help prevent chronic diseases.\n\n2. Engage in regular physical activity: Exercise is crucial for maintaining strong bones, muscles, and cardiovascular health. Aim for at least 150 minutes of moderate aerobic exercise or 75 minutes of vigorous exercise each week.\n\n3. Get enough sleep: Getting enough quality sleep is crucial for physical and mental well-being. It helps to regulate mood, improve cognitive function, and supports healthy growth and immune function. Aim for 7-9 hours of sleep each night."}
{"instruction_zh": "什么是三原色?", "input_zh": "", "output_zh": "三原色是红、蓝、黄。这些颜色被称为原色,因为它们不能通过混合其他颜色来创建,而所有其他颜色都可以通过以不同比例组合它们来制作。在用于光的加法色彩系统中,原色是红、绿、蓝(RGB)。", "instruction": "What are the three primary colors?", "input": "", "output": "The three primary colors are red, blue, and yellow. These colors are called primary because they cannot be created by mixing other colors and all other colors can be made by combining them in various proportions. In the additive color system, used for light, the primary colors are red, green, and blue (RGB)."}
{"instruction_zh": "描述一个原子的结构。", "input_zh": "", "output_zh": "原子是所有物质的基本构建单元,由三种粒子组成:质子、中子和电子。原子的结构可以描述为中心的核心被一团电子云所包围。原子的核心由质子和中子组成。质子是带正电的粒子,中子是没有电荷的中性粒子。这两种粒子都位于原子的核心中心,其中包含了大部分原子的质量。原子核周围是一团电子云。电子是带负电的粒子,不断地在核心周围运动。电子云被分为壳层或轨道,每个壳层可以容纳一定数量的电子。外层壳层中电子的数量,称为价层电子数,决定了原子的化学性质。在一个中性原子中,核心中质子的数量等于电子云中电子的数量,因此正负电荷平衡,原子没有总电荷。质子的数量,也称为原子序数,决定了原子的元素。", "instruction": "Describe the structure of an atom.", "input": "", "output": "An atom is the basic building block of all matter and is made up of three types of particles: protons, neutrons, and electrons. The structure of an atom can be described as a nucleus at the center surrounded by a cloud of electrons.\n\nThe nucleus of an atom is made up of protons and neutrons. Protons are positively charged particles and neutrons are neutral particles with no charge. Both of these particles are located in the nucleus of the atom, which is at the center of the atom and contains most of the atom's mass.\n\nSurrounding the nucleus of the atom is a cloud of electrons. Electrons are negatively charged particles that are in constant motion around the nucleus. The electron cloud is divided into shells or orbitals, and each shell can hold a certain number of electrons. The number of electrons in the outermost shell, called the valence shell, determines the chemical properties of the atom. \n\nIn a neutral atom, the number of protons in the nucleus is equal to the number of electrons in the electron cloud, so the positive and negative charges balance out and the atom has no overall charge. The number of protons, also called the atomic number, determines what element the atom is."}
需要改成jsonl的格式,一行一个json是一条数据,类似这样 ``` {"instruction_zh": "给出三个保持健康的小贴士。", "input_zh": "", "output_zh": "1. 饮食要均衡且富有营养:确保你的餐食包含各种水果、蔬菜、瘦肉、全谷物和健康脂肪。这有助于为身体提供必要的营养,使其发挥最佳功能,并有助于预防慢性疾病。2. 经常参加体育锻炼:锻炼对于保持强壮的骨骼、肌肉和心血管健康至关重要。每周至少要进行150分钟的中等有氧运动或75分钟的剧烈运动。3. 获得足够的睡眠:获得足够的高质量睡眠对身体和心理健康至关重要。它有助于调节情绪,提高认知功能,并支持健康的生长和免疫功能。每晚睡眠目标为7-9小时。", "instruction": "Give three tips for staying healthy.", "input": "", "output": "1. Eat a balanced and nutritious diet: Make sure your meals are inclusive of a variety of fruits and vegetables, lean protein, whole grains, and healthy fats. This helps to provide your body with the essential nutrients to function at its best and can help prevent chronic diseases.\n\n2. Engage in regular physical activity: Exercise is crucial for maintaining strong bones, muscles, and cardiovascular health. Aim for at least 150 minutes of moderate aerobic exercise or 75 minutes of vigorous exercise each week.\n\n3. Get enough sleep: Getting enough quality sleep is crucial for physical and mental well-being. It helps to regulate mood, improve cognitive function, and supports healthy growth and immune function. Aim for 7-9 hours of sleep each night."} {"instruction_zh": "什么是三原色?", "input_zh": "", "output_zh": "三原色是红、蓝、黄。这些颜色被称为原色,因为它们不能通过混合其他颜色来创建,而所有其他颜色都可以通过以不同比例组合它们来制作。在用于光的加法色彩系统中,原色是红、绿、蓝(RGB)。", "instruction": "What are the three primary colors?", "input": "", "output": "The three primary colors are red, blue, and yellow. These colors are called primary because they cannot be created by mixing other colors and all other colors can be made by combining them in various proportions. In the additive color system, used for light, the primary colors are red, green, and blue (RGB)."} {"instruction_zh": "描述一个原子的结构。", "input_zh": "", "output_zh": "原子是所有物质的基本构建单元,由三种粒子组成:质子、中子和电子。原子的结构可以描述为中心的核心被一团电子云所包围。原子的核心由质子和中子组成。质子是带正电的粒子,中子是没有电荷的中性粒子。这两种粒子都位于原子的核心中心,其中包含了大部分原子的质量。原子核周围是一团电子云。电子是带负电的粒子,不断地在核心周围运动。电子云被分为壳层或轨道,每个壳层可以容纳一定数量的电子。外层壳层中电子的数量,称为价层电子数,决定了原子的化学性质。在一个中性原子中,核心中质子的数量等于电子云中电子的数量,因此正负电荷平衡,原子没有总电荷。质子的数量,也称为原子序数,决定了原子的元素。", "instruction": "Describe the structure of an atom.", "input": "", "output": "An atom is the basic building block of all matter and is made up of three types of particles: protons, neutrons, and electrons. The structure of an atom can be described as a nucleus at the center surrounded by a cloud of electrons.\n\nThe nucleus of an atom is made up of protons and neutrons. Protons are positively charged particles and neutrons are neutral particles with no charge. Both of these particles are located in the nucleus of the atom, which is at the center of the atom and contains most of the atom's mass.\n\nSurrounding the nucleus of the atom is a cloud of electrons. Electrons are negatively charged particles that are in constant motion around the nucleus. The electron cloud is divided into shells or orbitals, and each shell can hold a certain number of electrons. The number of electrons in the outermost shell, called the valence shell, determines the chemical properties of the atom. \n\nIn a neutral atom, the number of protons in the nucleus is equal to the number of electrons in the electron cloud, so the positive and negative charges balance out and the atom has no overall charge. The number of protons, also called the atomic number, determines what element the atom is."} ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HswOAuth/llm_course#389
No description provided.