在autodl上微调llama3_8b_instruct #347

Open
opened 2024-11-04 19:05:58 +08:00 by 18800352607 · 0 comments

注意:1.如果你的json文件做成了如下所示:

[{
    "conversation":[
        {
            "system": "xxx",
            "input": "xxx",
            "output": "xxx"
        }
    ]
},
{
    "conversation":[
        {
            "system": "xxx",
            "input": "xxx",
            "output": "xxx"
        }
    ]
}]

则在llama3_8b_instruct_qlora_alpaca_e3_copy.py文件里做如下修改:
dataset=dict(type=load_dataset, path=alpaca_en_path), 改为
dataset=dict(type=load_dataset, path='json', data_files=dict(train=alpaca_en_path)),

dataset_map_fn=alpaca_map_fn,改为
dataset_map_fn=None,
2.mpi4py安装时,要用 conda install mpi4py,不然会报错
微调结果:
输入问题:A man is 28 yrs old and his semen counting is 64%, he wants a child so what can he do?,输出:
image
输入问题:There is this lump towards the left center side of my stomach, what could it be?,输出:
image

注意:1.如果你的json文件做成了如下所示: ``` [{ "conversation":[ { "system": "xxx", "input": "xxx", "output": "xxx" } ] }, { "conversation":[ { "system": "xxx", "input": "xxx", "output": "xxx" } ] }] ``` 则在llama3_8b_instruct_qlora_alpaca_e3_copy.py文件里做如下修改: `dataset=dict(type=load_dataset, path=alpaca_en_path), ` 改为 `dataset=dict(type=load_dataset, path='json', data_files=dict(train=alpaca_en_path)),` `dataset_map_fn=alpaca_map_fn,`改为 `dataset_map_fn=None,` 2.mpi4py安装时,要用 `conda install mpi4py`,不然会报错 微调结果: 输入问题:A man is 28 yrs old and his semen counting is 64%, he wants a child so what can he do?,输出: <img width="1502" alt="image" src="/attachments/f554fe5e-6bc7-422c-946c-1408a607bf37"> 输入问题:There is this lump towards the left center side of my stomach, what could it be?,输出: <img width="1513" alt="image" src="/attachments/e06422f8-7867-4bd3-93ea-c6a4598bb9c0">
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 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#347
No description provided.