Skip to content

Add code highlight to chapter2/1.mdx #760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chapters/zh-CN/chapter2/1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

🤗 Transformers 库应运而生,就是为了解决这个问题。它的目标是提供一个统一的 API 接口,通过它可以加载、训练和保存任何 Transformer 模型。该库的主要特点有:
- **易于使用**:仅需两行代码,就能下载、加载并使用先进的 NLP 模型进行推理。
- **灵活**:在本质上,所有的模型都是简单的 PyTorch nn.Module 或 TensorFlow tf.keras.Model 类,并可像在各自的机器学习(ML)框架中处理其他模型一样处理它们。
- **灵活**:在本质上,所有的模型都是简单的 PyTorch `nn.Module` 或 TensorFlow `tf.keras.Model` 类,并可像在各自的机器学习(ML)框架中处理其他模型一样处理它们。
- **简单**:该库几乎没有进行任何抽象化。🤗 Transformers 库一个核心概念是“全在一个文件中”:模型的前向传播完全在一个文件中定义,这使得代码本身易于理解和修改。

最后一个特性使🤗 Transformers 与其他 ML 库截然不同。模型并非建立在跨越多个代码文件共享的模块上;相反,每一个模型都有自己的层次结构。除了使模型更加容易接受和更容易理解,这还允许你轻松地在一个模型上实验,而且不影响其他模型。
Expand All @@ -20,4 +20,4 @@

<Tip>
⚠️ 为了充分利用 Model Hub 和🤗 Transformers 提供的所有功能,我们建议你<a href="https://huggingface.co/join">创建一个账户</a>。
</Tip>
</Tip>