文档中心>TI-ONE 训练平台>实践教程>使用任务式建模精调内置大模型

使用任务式建模精调内置大模型

最近更新时间:2024-05-16 14:52:31

我的收藏

步骤速览

一、新建 CFS:在 CFS 控制台,新建自己的 CFS 文件存储系统。
二、挂载 CFS:新建并启动 Notebook,挂载 CFS 后管理 CFS 文件目录。(若您希望使用自己的业务数据精调大模型,则可在此步同时上传业务数据文件到 CFS;当然平台也为您内置了一份示例数据用于快速启动精调任务)。
三、快速试一试,选型基底模型:在“大模型精调”界面下,选择合适模型,快速试一试。若您后续采用内置示例数据精调模型,则可用以下问题测试精调前基底模型效果。
测试 prompt1 内容:
"Explain the text in one sentence. \\n Text:(CNN) -- Actress Lindsay Lohan's father jumped from a third-floor balcony Thursday to try to escape re-arrest, police said, but officers soon caught up with him and took him into custody -- again.\\n\\nOfficers detained Michael Lohan after his girlfriend, Kate Major, said he violated terms of his release from jail earlier this week by calling her, the Tampa Police Department said in a statement. Investigators arrested Lohan on suspicion of domestic violence after an incident on Monday night, but they let him out of jail after he posted bail.\\n\\nJust after 1 a.m. Thursday, Lohan's girlfriend called police to say Lohan had violated the terms of his release by calling her, the police statement said. Lohan called his girlfriend again while she was talking with police, and she put him on speakerphone, it said.\\n\\nAfter prosecutors authorized Lohan's re-arrest, officers went to a hotel, the Tahitian Inn, where he was staying.\\n\\n\\"Upon seeing officers, he jumped out of a third-story balcony in an attempt to escape arrest,\\" the police statement said.\\n\\nOfficers took him into custody after a short chase and discovered after taking him to jail that he may have broken his foot, police said. Doctors were evaluating him.\\n\\nLohan is not expected to be released from Tampa General Hospital Thursday and has been admitted for overnight observation, said Tampa police spokeswoman Andrea Davis.\\n\\nPolice responded to a domestic violence call at Michael Lohan's home Monday and arrested him for the battery of his live-in girlfriend, police said.\\n\\nLohan told reporters Wednesday he \\"didn't lay a hand\\" on his girlfriend.\\n\\n\\"I did not hurt her,\\" he said.\\n\\nLohan also said he never was served with a restraining order to stay away from the woman. According to CNN Tampa affiliate WFTS, a Sarasota County judge issued a temporary restraining order Tuesday.\\n\\nLohan, 51, was arrested in Los Angeles in March in connection with alleged domestic violence and was charged with one misdemeanor count of corporal injury to a cohabitant.\\n\\nThe relationship between Lohan and his daughter has been publicly strained for years, although the two did undergo family counseling together during her treatment at the Betty Ford Center.\\n\\nCNN's Rich Phillips contributed to this report.\\n\\n"
测试 prompt2 内容:
"Explain the text in one sentence. \\n Text:(CNN) -- A federal judge Friday ruled in favor of a former UCLA college basketball star who sued to end the NCAA's control over the rights to college athletes' names, images and likenesses.\\n\\nIn a landmark decision, U.S. District Judge Claudia Wilken sided with Ed O'Bannon in his lawsuit against the National Collegiate Athletic Association. O'Bannon argued athletes in the top tier of college basketball and football should be allowed to profit from their schools' use of their likenesses.\\n\\nIn a 99-page ruling, Wilken wrote that current NCAA rules \\"unreasonably restrain trade in the market for certain educational and athletic opportunities offered by NCAA Division I schools.\\"\\n\\nWilken issued an injunction to block the NCAA from prohibiting its member schools and conferences from offering their Football Bowl Subdivision or Division I basketball recruits a limited share of the revenues generated from the use of their names, images, and likenesses.\\n\\nShe did rule, however, that the NCAA could set a cap on the money paid to athletes, as long as it allows at least $5,000 per athlete per year.\\n\\n\\"The NCAA's witnesses stated that their concerns about student-athlete compensation would be minimized or negated if compensation was capped at a few thousand dollars per year,\\" the judge wrote.\\n\\nO'Bannon's suit alleged the waivers the athletes are required to sign are illegal and asked that players be able to collectively negotiate the terms of their likenesses in order to keep a share of those profits.\\n\\n\\"Before the court in this case is only whether the NCAA violates antitrust law by agreeing with its member schools to restrain their ability to compensate Division I men's basketball and FBS football players any more than the current association rules allow,\\" Wilken wrote. \\"For the reasons set forth above, the court finds that this restraint does violate antitrust law.\\"\\n\\nThe ruling could potentially change college sports drastically, eventually forcing the NCAA to restructure its amateur model and allow college athletes to be paid.\\n\\nNCAA chief legal officer Donald Remy said: \\"We disagree with the court's decision that NCAA rules violate antitrust laws. We note that the court's decision sets limits on compensation, but are reviewing the full decision and will provide further comment later.\\"\\n\\nWilliam Isaacson, an attorney for the plaintiffs, called the ruling \\"a big step forward for common decency.\\"\\n\\n\\"One of the things the judge is saying here .. is some sharing is OK,\\" he said. \\"It won't affect amateurism, won't affect the popularity of the sport. She made a very reasonable and significant and measured decision.\\"\\n\\nRamogi Huma, president of the National College Players Association, said the ruling was \\"a big win\\" that signaled \\"the time for college athletes to get their due,\\" though he was critical of the $5,000 compensation cap.\\n\\n\\"The ruling says the NCAA was operating illegally and college athletes do have rights,\\" said Huma, who helped find players to join the case. \\"Even if you label them student-athletes and want to call it amateurism, it doesn't give the NCAA the right to deny them the rights that other Americans deserve.\\"\\n\\nSonny Vaccaro, who started the lawsuit by introducing O'Bannon and lead attorney Michael Hausfeld, said the decision was precedent-setting.\\n\\n\\"The key is, they're allowed to get paid,\\" said Vacarro, who helped pioneer branding athletes by putting Nike shoes on Michael Jordan.\\n\\nVacarro called the decision his most important career accomplishment.\\n\\n\\"It's more important to me that these kids won and this go forward and the principles are right,\\" he said. \\"To me, it's more important than the Jordan and Kobe and things I did in my professional life. ...This was just something that was wrong and I totally believed in it.\\"\\n\\nThe judge wrote that the injunction will not affect student-athletes who enroll in college before July 1, 2016.\\n\\nWhen athletes commit to a university, players are required to sign a waiver that relinquishes their right to their own likenesses in every form.\\n\\nThat means they can't make money off their television appearances, their jerseys, or in any other way.\\n\\nThe universities get any revenues from selling sports paraphernalia or other material related to the players.\\n\\nThe trial began June 9 in federal court in Oakland, California. The plaintiffs were 20 current and former student athletes who play or played for an FBS football or Division I men's basketball team starting in 1956.\\n\\nLegal appeals could delay a final outcome for years but the decision is in a position to be the first major NCAA reform effort to take hold.\\n\\nAlready the issues brought up in the case have had an effect, even before the ruling was made.\\n\\nTexas A&M, the University of Arizona and Northwestern University have decided to stop selling jerseys with the numbers of specific players.\\n\\nInstead, Texas A&M will sell the number 12 jersey, in keeping with its 12th man tradition; and Arizona will sell jerseys with numbers that correspond to the year of competition -- 14 for this year, according to a school spokesman. Northwestern will sell only jersey number 51, in honor of its head coach, Pat Fitzgerald, and legendary Chicago linebacker Dick Butkus.\\n\\nThe NCAA's argument in both the ongoing O'Bannon suit and another one filed by former quarterback Sam Keller, also in federal court in Oakland, is that it is trying to protect the amateur model of college sports.\\n\\nPaying college athletes would hurt traditions, NCAA chief testifies\\n\\nNCAA under fire: 5 things to know\\n\\nNCAA faces change, legal challenges in months ahead\\n\\n"
四、启动训练任务:在“大模型精调”界面下,选择合适模型,新建训练任务,完成相关配置后启动训练。重点关注以下配置:
训练资源:建议最低使用以下资源配置。
模型参数
CPU
GPU
7B
40C 800G
A100*8 或 A800*8
13B
120C 1800G
A800*8
训练输出路径:配置到第二步新建的 CFS 文件目录。
根据需要修改“调优参数”。
五、监控训练过程:在“任务式建模”界面下,单击“任务名称”,查看训练监控和日志。
六、查看训练输出文件:打开第二步的 Notebook,查看 CFS 上的训练输出文件。
七、部署模型服务:在“在线服务”界面下,新建服务,完成相关配置后,启动服务。重点关注以下配置:
推理资源:建议最低使用以下资源配置。
模型参数
CPU
GPU
7B
12C 44G
A10*1
13B
16C 96G
A100*1
八、服务调用:在“在线服务”界面下,调用部署好的服务。
在线体验:单击“在线体验”测试模型效果。可用第三步测试基底模型的同一批问题再次测试精调后的模型,对比训练前后效果。
API 调用:通过 API 接口对接您的业务系统。

平台内置示例数据介绍:
英文 LLM 内置数据:1088 条英文新闻摘要生成数据对(下载查看
中文 LLM 内置数据:1094 条中文新闻摘要生成数据对(下载查看

前提条件

完成腾讯云 TI-ONE 训练平台 的服务注册与开通,请参考 账号与权限说明
完成腾讯云 私有网络 服务注册与开通,并完成私有网络创建,请参考 创建私有网络


一、新建 CFS

CFS(Cloud File Storage, CFS) 文件存储系统官方介绍:CFS 介绍文档,CFS 产品控制台
您新建的 CFS 文件存储系统在 TI 上的使用场景:
您用于精调大模型的业务数据需要上传到 CFS(您也可直接使用 TI 内置示例数据快速启动精调训练任务)。
大模型精调过程中,会产生一些模型中间结果(Checkpoint)、以及精调后最终得到的业务大模型等需要存储到您的 CFS 。

若您已有自己的 CFS 文件存储系统则可跳过本步骤;
若无,则可参考以下操作新建您的 CFS 。
“新建 CFS 文件存储系统”的具体操作:
1. CFS 产品控制台 ,在文件系统二级页面,单击创建按钮,选择适合您的“文件系统类型”(本示例选择了“通用标准型”),然后配置详细参数,本示例配置如下:

2. 待创建的“llm-sft-demo”文件系统状态变为“可使用”后,您后续在 TI 平台上就可使用此 CFS 挂载您的精调训练任务了。



二、挂载 CFS

本步骤的操作原因:
因为第一步中您新建的 CFS 下还只有一个根目录,您需要更好的组织 CFS 中的目录层级结构用于区分不同训练任务的不同输出路径,例如在根目录下新建一个“/sft-demo-20230825”的子目录作为本示例训练任务的输出路径。
若您希望用自己的业务数据精调大模型,则您也需要挂载 CFS 后,将训练数据文件上传到 CFS 中。

1. 新建 Notebook 实例并挂载用户 CFS
用户进入 腾讯云 TI 平台 ,在训练工坊 > Notebook二级页面,单击新建按钮,新建一个 Notebook 实例,且将用户的 CFS 配置挂载到该容器实例上,参数如下,请重点注意,您此时新建的 Notebook 所在地域需要和第一步中新建的 CFS 所在地域保持一致。
备注:
此时选择的“镜像”可在“内置镜像”中任意选择,因为该 Notebook 仅用于挂载 CFS 、可视化的管理 CFS 上的文件信息,对镜像中安装的依赖包没有特殊的要求。
此时选择的“算力规格”可用较小的“2C4G”启动 Notebook, 因为这个资源仅仅用于启动 Notebook 实例而不是最终大模型精调所用的训练资源。

2. 进入运行中的 Notebook
等待您新建的 Notebook 实例状态处于“运行中”后,单击操作 > 打开按钮,进入Notebook页面。

此时,您就可以通过 Notebook 界面,直接操作您的 CFS 文件系统了。您有 3 种操作场景:
新建文件夹:管理 CFS 上的文件目录,如新建一个“sft-demo-20230825”的文件夹后续用于作为本示例训练任务的输出目录。
上传本地文件到 CFS:若您希望用自己存储在本地的业务数据精调模型,则您可在此界面上传本地数据文件到 CFS。当然您也可直接使用平台为您内置的示例数据作为训练数据。
拉取 COS 数据到 CFS:打开“Terminal”,执行 coscmd 的相关命令,实现将存储在 COS 中的业务数据文件拉取到 CFS 文件系统中。可参考 COSCMD 工具 产品文档。


三、快速试一试,选型基底模型

1. 一键部署基底模型
用户进入 腾讯云 TI 平台 ,在大模型精调二级页面,选择您希望快速试一试模型效果的卡片,单击进入卡片详情。本示例以试一试“Llama2系列模型”的llama_2_7b_chat模型为例,单击新建在线服务按钮,启动服务配置页面。



单击后,平台会自动为您跳转到模型服务 > 在线服务的创建服务参数配置页面。



本页面重点参数配置如下:(其余参数都可使用默认值,不修改或按需修改)
服务名称:输入您的自定义服务名称。
计费模式:部署大模型推理服务支持“按量计费”和“包年包月”两种模式都可以。本示例采用“按量计费”。
服务实例
模型来源:选择 “镜像”类型。
模型和运行环境:系统已为您内置默认填充了“内置大模型/Llama2系列模型/llama_2_7b_chat”,也可选择其他内置模型,如Llama2系列下的llama_2_7b、llama_2_13b_chat、llama_2_13b、llama_2_70b_chat、llama_2_70b等。
算力规格:本示例选择 12C44GB A10*1 的机器配置,此外还支持V100、A100等机型(裸金属机型不支持)。
单击同意开源大模型的相关法律协议后,即可单击启动服务按钮。
2. 服务调用
创建服务后,前端自动返回模型服务 > 在线服务列表页面,待大模型服务状态为“运行中”中后,表示服务已成功启动运行。



服务调用分为两种方式:
2.1 API 调用
您可以通过单击操作 > 调用API 按钮进入模型调用指导文档页面。文档中建议您通过API Explorer 配置调用代码。
其中,需填写到 API Explorer 的“Model”参数取值需参考在线服务>名称>服务管理页面展示的“ ID”参数。



2.2 在线体验
您可以通过单击操作 > 在线体验 按钮进入模型快速体验页面。您可通过前端页面问答形式测试精调后的模型效果。



若您后续使用平台内置示例数据进行精调训练,则可尝试以下问题体验精调前基底模型效果。
测试 prompt1 内容:
"Explain the text in one sentence. \\n Text:(CNN) -- Actress Lindsay Lohan's father jumped from a third-floor balcony Thursday to try to escape re-arrest, police said, but officers soon caught up with him and took him into custody -- again.\\n\\nOfficers detained Michael Lohan after his girlfriend, Kate Major, said he violated terms of his release from jail earlier this week by calling her, the Tampa Police Department said in a statement. Investigators arrested Lohan on suspicion of domestic violence after an incident on Monday night, but they let him out of jail after he posted bail.\\n\\nJust after 1 a.m. Thursday, Lohan's girlfriend called police to say Lohan had violated the terms of his release by calling her, the police statement said. Lohan called his girlfriend again while she was talking with police, and she put him on speakerphone, it said.\\n\\nAfter prosecutors authorized Lohan's re-arrest, officers went to a hotel, the Tahitian Inn, where he was staying.\\n\\n\\"Upon seeing officers, he jumped out of a third-story balcony in an attempt to escape arrest,\\" the police statement said.\\n\\nOfficers took him into custody after a short chase and discovered after taking him to jail that he may have broken his foot, police said. Doctors were evaluating him.\\n\\nLohan is not expected to be released from Tampa General Hospital Thursday and has been admitted for overnight observation, said Tampa police spokeswoman Andrea Davis.\\n\\nPolice responded to a domestic violence call at Michael Lohan's home Monday and arrested him for the battery of his live-in girlfriend, police said.\\n\\nLohan told reporters Wednesday he \\"didn't lay a hand\\" on his girlfriend.\\n\\n\\"I did not hurt her,\\" he said.\\n\\nLohan also said he never was served with a restraining order to stay away from the woman. According to CNN Tampa affiliate WFTS, a Sarasota County judge issued a temporary restraining order Tuesday.\\n\\nLohan, 51, was arrested in Los Angeles in March in connection with alleged domestic violence and was charged with one misdemeanor count of corporal injury to a cohabitant.\\n\\nThe relationship between Lohan and his daughter has been publicly strained for years, although the two did undergo family counseling together during her treatment at the Betty Ford Center.\\n\\nCNN's Rich Phillips contributed to this report.\\n\\n"
测试 prompt2 内容:
"Explain the text in one sentence. \\n Text:(CNN) -- A federal judge Friday ruled in favor of a former UCLA college basketball star who sued to end the NCAA's control over the rights to college athletes' names, images and likenesses.\\n\\nIn a landmark decision, U.S. District Judge Claudia Wilken sided with Ed O'Bannon in his lawsuit against the National Collegiate Athletic Association. O'Bannon argued athletes in the top tier of college basketball and football should be allowed to profit from their schools' use of their likenesses.\\n\\nIn a 99-page ruling, Wilken wrote that current NCAA rules \\"unreasonably restrain trade in the market for certain educational and athletic opportunities offered by NCAA Division I schools.\\"\\n\\nWilken issued an injunction to block the NCAA from prohibiting its member schools and conferences from offering their Football Bowl Subdivision or Division I basketball recruits a limited share of the revenues generated from the use of their names, images, and likenesses.\\n\\nShe did rule, however, that the NCAA could set a cap on the money paid to athletes, as long as it allows at least $5,000 per athlete per year.\\n\\n\\"The NCAA's witnesses stated that their concerns about student-athlete compensation would be minimized or negated if compensation was capped at a few thousand dollars per year,\\" the judge wrote.\\n\\nO'Bannon's suit alleged the waivers the athletes are required to sign are illegal and asked that players be able to collectively negotiate the terms of their likenesses in order to keep a share of those profits.\\n\\n\\"Before the court in this case is only whether the NCAA violates antitrust law by agreeing with its member schools to restrain their ability to compensate Division I men's basketball and FBS football players any more than the current association rules allow,\\" Wilken wrote. \\"For the reasons set forth above, the court finds that this restraint does violate antitrust law.\\"\\n\\nThe ruling could potentially change college sports drastically, eventually forcing the NCAA to restructure its amateur model and allow college athletes to be paid.\\n\\nNCAA chief legal officer Donald Remy said: \\"We disagree with the court's decision that NCAA rules violate antitrust laws. We note that the court's decision sets limits on compensation, but are reviewing the full decision and will provide further comment later.\\"\\n\\nWilliam Isaacson, an attorney for the plaintiffs, called the ruling \\"a big step forward for common decency.\\"\\n\\n\\"One of the things the judge is saying here .. is some sharing is OK,\\" he said. \\"It won't affect amateurism, won't affect the popularity of the sport. She made a very reasonable and significant and measured decision.\\"\\n\\nRamogi Huma, president of the National College Players Association, said the ruling was \\"a big win\\" that signaled \\"the time for college athletes to get their due,\\" though he was critical of the $5,000 compensation cap.\\n\\n\\"The ruling says the NCAA was operating illegally and college athletes do have rights,\\" said Huma, who helped find players to join the case. \\"Even if you label them student-athletes and want to call it amateurism, it doesn't give the NCAA the right to deny them the rights that other Americans deserve.\\"\\n\\nSonny Vaccaro, who started the lawsuit by introducing O'Bannon and lead attorney Michael Hausfeld, said the decision was precedent-setting.\\n\\n\\"The key is, they're allowed to get paid,\\" said Vacarro, who helped pioneer branding athletes by putting Nike shoes on Michael Jordan.\\n\\nVacarro called the decision his most important career accomplishment.\\n\\n\\"It's more important to me that these kids won and this go forward and the principles are right,\\" he said. \\"To me, it's more important than the Jordan and Kobe and things I did in my professional life. ...This was just something that was wrong and I totally believed in it.\\"\\n\\nThe judge wrote that the injunction will not affect student-athletes who enroll in college before July 1, 2016.\\n\\nWhen athletes commit to a university, players are required to sign a waiver that relinquishes their right to their own likenesses in every form.\\n\\nThat means they can't make money off their television appearances, their jerseys, or in any other way.\\n\\nThe universities get any revenues from selling sports paraphernalia or other material related to the players.\\n\\nThe trial began June 9 in federal court in Oakland, California. The plaintiffs were 20 current and former student athletes who play or played for an FBS football or Division I men's basketball team starting in 1956.\\n\\nLegal appeals could delay a final outcome for years but the decision is in a position to be the first major NCAA reform effort to take hold.\\n\\nAlready the issues brought up in the case have had an effect, even before the ruling was made.\\n\\nTexas A&M, the University of Arizona and Northwestern University have decided to stop selling jerseys with the numbers of specific players.\\n\\nInstead, Texas A&M will sell the number 12 jersey, in keeping with its 12th man tradition; and Arizona will sell jerseys with numbers that correspond to the year of competition -- 14 for this year, according to a school spokesman. Northwestern will sell only jersey number 51, in honor of its head coach, Pat Fitzgerald, and legendary Chicago linebacker Dick Butkus.\\n\\nThe NCAA's argument in both the ongoing O'Bannon suit and another one filed by former quarterback Sam Keller, also in federal court in Oakland, is that it is trying to protect the amateur model of college sports.\\n\\nPaying college athletes would hurt traditions, NCAA chief testifies\\n\\nNCAA under fire: 5 things to know\\n\\nNCAA faces change, legal challenges in months ahead\\n\\n"

四、启动训练任务

1. 训练入口
用户进入 腾讯云 TI 平台 ,在大模型精调二级页面,选择您需要精调的大模型卡片,单击卡片进入模型详情页面。本示例以精调“Llama2系列模型”的llama_2_7b_chat模型为例。
单击详情页面的“新建训练任务”即可开始零代码精调大模型。
其中,精调任务的训练数据来源有两种:
若您想快速体验大模型精调流程,则您无需任何操作可直接使用平台内置示例数据一键启动精调。您可单击此页面的示例数据按钮下载查看示例数据内容。
若您需要用自定义业务数据精调大模型,则可参考本文档的 二、挂载 CFS 将业务数据上传到您的 CFS 中。



2. 训练参数配置
单击小卡片详情页的新建训练任务按钮后,平台自动为您跳转到训练工坊 > 任务式建模的“新建任务”参数配置页面:
2.1 基本信息

本页面重点参数配置如下:
任务名称:输入您的自定义任务名称。
训练框架:此时平台已自动为您选中“训练框架”为“内置大模型/llama系列/llama_2_7b_chat_hf”。
计费模式:二选一
按量计费:可选择 “164C 948G A100*8” 的算力规格(V100 不支持、裸金属机型不支持)。
包年包月:本示例是采用 A800 的机型配置进行精调,而 A800 机器目前仅能通过“包年包月”的计费模式采购到。若您还没有包年包月的资源组,可参考 资源组管理 产品文档新建。
资源组:选择您采购了 A800 卡机型所在的资源组。
资源申请:CPU 建议40核、内存建议 800G、卡型号建议 A800、GPU建议8卡、节点数建议1个。
单击下一步按钮。
2.2 任务配置

本页面重点参数配置如下:
数据配置:默认选中“CFS”(目前大模型精调仅支持 CFS 类型的数据配置)。
选择存储路径
第一行 “平台CFS”:系统默认为您配置了精调该大模型的配套训练代码。
第二行 “平台CFS”:
系统默认为您配置了一份精调该大模型的示例数据;
若您希望使用自定义业务数据精调该大模型,可切换此处的 CFS 文件系统为您在第一步中新建的文件系统(如本示例第一步中新建的“llm-sft-demo”),并选择您在第二步中上传的业务数据所在的“源路径”即可。
第三行 “用户CFS”:此处需选择您的 CFS 文件系统(如本示例第一步中新建的“llm-sft-demo”);“源路径”需填写第二步中新建的子目录如“sft-demo-20230825”;“本地存储路径”为系统默认填充您无需修改。
代码包:无需选择(大模型精调场景中您无需选择代码包)。
启动命令:系统默认填充您无需修改(用于启动大模型默认配套的训练代码)。
训练输出:无需选择(大模型精调场景中您无需选择训练输出)。
调优参数:为系统默认填充,您可按需修改。
Epoch: 训练过程中的迭代轮次。
BatchSize: 每轮训练迭代中的样本数。BatchSize越大,训练速度越快同时内存占用越高。
LearningRate: 梯度下降过程中更新权重的超参,过高导致模型难以收敛,过低导致模型收敛速度过慢。
Step: 每跑多少个Step保存一次模型的checkpoint,保存checkpoint越多需要的存储空间越大。
UseTilearn:是否要开启腾讯自研加速,"true/false"。
FinetuningType:用户可自定义选择精调训练模式“Lora/Full”。
Validation:支持用户设置验证集占整个数据集的比例。
MaxSequenceLength:最大文本序列长度,默认“2048”,超过该长度的训练文本将被自动截断。
配置完成后,您需单击同意开源大模型精调相关法律协议。最后单击确定按钮即可启动训练。

五、监控训练过程

当任务处于“运行中”状态时,您可单击任务名称,查看任务详情。

您可切换“基本信息/实例列表/监控/日志/事件”页面查看本次训练任务的详细信息。如监控页面的“资源监控”页面可实时观察资源使用率。



六、查看训练输出文件

若您使用平台内置的示例数据进行精调体验,按本示例的资源配置和参数配置,约 10 分钟即可完成一次精调训练。
当任务状态为“已完成”时,您的业务数据精调大模型的训练任务即成功完成。

精调后得到的大模型存储在您启动训练任务时配置的自定义 CFS 输出路径下。您可通过再次打开第二步中新建的 Notebook 实例,查看 CFS 文件系统上本次训练任务的输出文件列表。


七、部署模型服务

训练成功后,若您想部署精调后的大模型,则可切换到模型服务 > 在线服务二级菜单页面。
在服务列表页面单击新建服务按钮,进入服务参数配置页面:

本页面重点参数配置如下:(其余参数都可使用默认值,不修改或按需修改)
服务名称:输入您的自定义服务名称。
计费模式:部署大模型推理服务支持“按量计费”和“包年包月”两种模式都可以
本示例采用“按量计费”。
模型来源:选择 “CFS”类型(因为您在配置训练任务时,设置了将精调后的模型存储到自定义 CFS 文件系统中)。
选择模型
参数1: 选择存储精调后的大模型的您的 CFS 文件系统名称。
参数2: 输入具体的模型存储路径(此路径和您在训练参数配置时的“源路径”保持一致即可)。
运行环境:选择“LLM(1.0.0)/vllm”。
算力规格:本示例选择了“8C40G V100*1”,此外还支持A100、A10 机型。
最后,同意大模型相关法律协议后,即可单击一键启动服务按钮。

八、服务调用

返回模型服务 > 在线服务列表页面,待大模型服务状态为“运行中”中后,表示服务已成功启动运行。
服务调用的两种方式参考第三步中的2.服务调用即可。
若您后续使用平台内置示例数据进行精调训练,则可尝试以下问题体验精调前基底模型效果。
测试 prompt1 内容:
"Explain the text in one sentence. \\n Text:(CNN) -- Actress Lindsay Lohan's father jumped from a third-floor balcony Thursday to try to escape re-arrest, police said, but officers soon caught up with him and took him into custody -- again.\\n\\nOfficers detained Michael Lohan after his girlfriend, Kate Major, said he violated terms of his release from jail earlier this week by calling her, the Tampa Police Department said in a statement. Investigators arrested Lohan on suspicion of domestic violence after an incident on Monday night, but they let him out of jail after he posted bail.\\n\\nJust after 1 a.m. Thursday, Lohan's girlfriend called police to say Lohan had violated the terms of his release by calling her, the police statement said. Lohan called his girlfriend again while she was talking with police, and she put him on speakerphone, it said.\\n\\nAfter prosecutors authorized Lohan's re-arrest, officers went to a hotel, the Tahitian Inn, where he was staying.\\n\\n\\"Upon seeing officers, he jumped out of a third-story balcony in an attempt to escape arrest,\\" the police statement said.\\n\\nOfficers took him into custody after a short chase and discovered after taking him to jail that he may have broken his foot, police said. Doctors were evaluating him.\\n\\nLohan is not expected to be released from Tampa General Hospital Thursday and has been admitted for overnight observation, said Tampa police spokeswoman Andrea Davis.\\n\\nPolice responded to a domestic violence call at Michael Lohan's home Monday and arrested him for the battery of his live-in girlfriend, police said.\\n\\nLohan told reporters Wednesday he \\"didn't lay a hand\\" on his girlfriend.\\n\\n\\"I did not hurt her,\\" he said.\\n\\nLohan also said he never was served with a restraining order to stay away from the woman. According to CNN Tampa affiliate WFTS, a Sarasota County judge issued a temporary restraining order Tuesday.\\n\\nLohan, 51, was arrested in Los Angeles in March in connection with alleged domestic violence and was charged with one misdemeanor count of corporal injury to a cohabitant.\\n\\nThe relationship between Lohan and his daughter has been publicly strained for years, although the two did undergo family counseling together during her treatment at the Betty Ford Center.\\n\\nCNN's Rich Phillips contributed to this report.\\n\\n"
测试 prompt2 内容:
"Explain the text in one sentence. \\n Text:(CNN) -- A federal judge Friday ruled in favor of a former UCLA college basketball star who sued to end the NCAA's control over the rights to college athletes' names, images and likenesses.\\n\\nIn a landmark decision, U.S. District Judge Claudia Wilken sided with Ed O'Bannon in his lawsuit against the National Collegiate Athletic Association. O'Bannon argued athletes in the top tier of college basketball and football should be allowed to profit from their schools' use of their likenesses.\\n\\nIn a 99-page ruling, Wilken wrote that current NCAA rules \\"unreasonably restrain trade in the market for certain educational and athletic opportunities offered by NCAA Division I schools.\\"\\n\\nWilken issued an injunction to block the NCAA from prohibiting its member schools and conferences from offering their Football Bowl Subdivision or Division I basketball recruits a limited share of the revenues generated from the use of their names, images, and likenesses.\\n\\nShe did rule, however, that the NCAA could set a cap on the money paid to athletes, as long as it allows at least $5,000 per athlete per year.\\n\\n\\"The NCAA's witnesses stated that their concerns about student-athlete compensation would be minimized or negated if compensation was capped at a few thousand dollars per year,\\" the judge wrote.\\n\\nO'Bannon's suit alleged the waivers the athletes are required to sign are illegal and asked that players be able to collectively negotiate the terms of their likenesses in order to keep a share of those profits.\\n\\n\\"Before the court in this case is only whether the NCAA violates antitrust law by agreeing with its member schools to restrain their ability to compensate Division I men's basketball and FBS football players any more than the current association rules allow,\\" Wilken wrote. \\"For the reasons set forth above, the court finds that this restraint does violate antitrust law.\\"\\n\\nThe ruling could potentially change college sports drastically, eventually forcing the NCAA to restructure its amateur model and allow college athletes to be paid.\\n\\nNCAA chief legal officer Donald Remy said: \\"We disagree with the court's decision that NCAA rules violate antitrust laws. We note that the court's decision sets limits on compensation, but are reviewing the full decision and will provide further comment later.\\"\\n\\nWilliam Isaacson, an attorney for the plaintiffs, called the ruling \\"a big step forward for common decency.\\"\\n\\n\\"One of the things the judge is saying here .. is some sharing is OK,\\" he said. \\"It won't affect amateurism, won't affect the popularity of the sport. She made a very reasonable and significant and measured decision.\\"\\n\\nRamogi Huma, president of the National College Players Association, said the ruling was \\"a big win\\" that signaled \\"the time for college athletes to get their due,\\" though he was critical of the $5,000 compensation cap.\\n\\n\\"The ruling says the NCAA was operating illegally and college athletes do have rights,\\" said Huma, who helped find players to join the case. \\"Even if you label them student-athletes and want to call it amateurism, it doesn't give the NCAA the right to deny them the rights that other Americans deserve.\\"\\n\\nSonny Vaccaro, who started the lawsuit by introducing O'Bannon and lead attorney Michael Hausfeld, said the decision was precedent-setting.\\n\\n\\"The key is, they're allowed to get paid,\\" said Vacarro, who helped pioneer branding athletes by putting Nike shoes on Michael Jordan.\\n\\nVacarro called the decision his most important career accomplishment.\\n\\n\\"It's more important to me that these kids won and this go forward and the principles are right,\\" he said. \\"To me, it's more important than the Jordan and Kobe and things I did in my professional life. ...This was just something that was wrong and I totally believed in it.\\"\\n\\nThe judge wrote that the injunction will not affect student-athletes who enroll in college before July 1, 2016.\\n\\nWhen athletes commit to a university, players are required to sign a waiver that relinquishes their right to their own likenesses in every form.\\n\\nThat means they can't make money off their television appearances, their jerseys, or in any other way.\\n\\nThe universities get any revenues from selling sports paraphernalia or other material related to the players.\\n\\nThe trial began June 9 in federal court in Oakland, California. The plaintiffs were 20 current and former student athletes who play or played for an FBS football or Division I men's basketball team starting in 1956.\\n\\nLegal appeals could delay a final outcome for years but the decision is in a position to be the first major NCAA reform effort to take hold.\\n\\nAlready the issues brought up in the case have had an effect, even before the ruling was made.\\n\\nTexas A&M, the University of Arizona and Northwestern University have decided to stop selling jerseys with the numbers of specific players.\\n\\nInstead, Texas A&M will sell the number 12 jersey, in keeping with its 12th man tradition; and Arizona will sell jerseys with numbers that correspond to the year of competition -- 14 for this year, according to a school spokesman. Northwestern will sell only jersey number 51, in honor of its head coach, Pat Fitzgerald, and legendary Chicago linebacker Dick Butkus.\\n\\nThe NCAA's argument in both the ongoing O'Bannon suit and another one filed by former quarterback Sam Keller, also in federal court in Oakland, is that it is trying to protect the amateur model of college sports.\\n\\nPaying college athletes would hurt traditions, NCAA chief testifies\\n\\nNCAA under fire: 5 things to know\\n\\nNCAA faces change, legal challenges in months ahead\\n\\n"