LLM 課程文件

章節末測驗

Hugging Face's logo
加入 Hugging Face 社群

並獲得增強的文件體驗

開始使用

章末測驗

Ask a Question

1. 語言建模流水線的順序是什麼?

2. 基礎 Transformer 模型輸出的張量有多少個維度,它們分別是什麼?

3. 以下哪項是子詞分詞的示例?

4. 什麼是模型頭?

5. 什麼是 AutoModel?

6. 批次處理不同長度的序列時需要注意哪些技術?

7. 對序列分類模型輸出的 logits 應用 SoftMax 函式的目的是什麼?

8. 大部分分詞器 API 以哪個方法為中心?

9. 此程式碼示例中的 result 變數包含什麼?

from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
result = tokenizer.tokenize("Hello!")

10. 以下程式碼有什麼問題嗎?

from transformers import AutoTokenizer, AutoModel

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
model = AutoModel.from_pretrained("gpt2")

encoded = tokenizer("Hey!", return_tensors="pt")
result = model(**encoded)
< > 在 GitHub 上更新

© . This site is unofficial and not affiliated with Hugging Face, Inc.