Skip to content

Conversation

@xiaodouzi666
Copy link

No description provided.

Copy link
Contributor

@zhongdongy zhongdongy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @xiaodouzi666 , please note the comments and update your translations accordingly. Feel free to discuss~ 🤗

"# 使用 LoRA Hugging Face 进行高效的大型语言模型训练\n",
"\n",
"In this sagemaker example, we are going to learn how to apply [Low-Rank Adaptation of Large Language Models (LoRA)](https://arxiv.org/abs/2106.09685) to fine-tune BLOOMZ (7 billion parameter version instruction tuned version of BLOOM) on a single GPU. We are going to leverage Hugging Face [Transformers](https://huggingface.co/docs/transformers/index), [Accelerate](https://huggingface.co/docs/accelerate/index), and [PEFT](https://github.com/huggingface/peft). \n",
"在这个 sagemaker 示例中,我们将学习如何应用 [Low-Rank Adaptation of Large Language Models (LoRA)](https://arxiv.org/abs/2106.09685) 来微调 BLOOMZ (BLOOM 70亿参数版本指令调优版本) 在单块GPU上。 我们将利用 Hugging Face [Transformers](https://huggingface.co/docs/transformers/index), [Accelerate](https://huggingface.co/docs/accelerate/index), 以及 [PEFT](https://github.com/huggingface/peft). \n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line violates grammar rules, please check.

"\n",
"We defined a `prompt_template` which we will use to construct an instruct prompt for better performance of our model. Our `prompt_template` has a “fixed” start and end, and our document is in the middle. This means we need to ensure that the “fixed” template parts + document are not exceeding the max length of the model. \n",
"We preprocess our dataset before training and save it to disk to then upload it to S3. You could run this step on your local machine or a CPU and upload it to the [Hugging Face Hub](https://huggingface.co/docs/hub/datasets-overview)."
"我们定义了一个' prompt_template ',我们将使用它来构造一个指示提示符,以提高模型的性能。我们的' prompt_template '有一个固定的开始和结束,我们的文档在中间。这意味着我们需要确保“固定”模板部件+文档不超过模型的最大长度。\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reconsider translation of instruct prompt.

"SageMaker 通过创建 SageMaker 端点配置和 SageMaker 端点来启动部署过程。 端点配置定义模型和实例类型。\n",
"\n",
"Lets test by using a example from the `test` split."
"让我们使用“测试”拆分中的示例进行测试。"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reconsider wording of split.

"metadata": {},
"source": [
"The trainign took `20632` seconds, which is about `5.7` hours. The `ml.g5.2xlarge` instance we used costs `$1.515` per hour. So the total cost for training BLOOMZ 7B was is `$8.63`. We could reduce the cost by using a spot instance, but the training time could increase, by waiting or restarts."
"训练用了“20632”秒,大约是“5.7”小时。 我们使用的“ml.g5.2xlarge”实例每小时收费“1.515 美元”。 因此,训练 BLOOMZ 7B 的总成本为 8.63 美元。 我们可以通过使用 spot 实例来降低成本,但是通过等待或重启可能会增加训练时间。"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reconsider wording of by in this sentence. It feels more like giving reason or explanation.

"\n",
"In order to create a sagemaker training job we need an `HuggingFace` Estimator. The Estimator handles end-to-end Amazon SageMaker training and deployment tasks. The Estimator manages the infrastructure use. \n",
"SagMaker takes care of starting and managing all the required ec2 instances for us, provides the correct huggingface container, uploads the provided scripts and downloads the data from our S3 bucket into the container at `/opt/ml/input/data`. Then, it starts the training job by running.\n",
"为了创建 sagemaker 训练作业,我们需要一个 HuggingFace 估计器。 Estimator 处理端到端的 Amazon SageMaker 训练和部署任务。 Estimator 管理基础设施的使用。\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For estimator object, I think it should be okay to leave estimator untranslated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants