Skip to content
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
6 changes: 3 additions & 3 deletions chapters/en/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ generator("In this course, we will teach you how to")
'HTTP'}]
```

You can control how many different sequences are generated with the argument `num_return_sequences` and the total length of the output text with the argument `max_length`.
You can control how many different sequences are generated with the argument `num_return_sequences` and the maximum number of newly generated tokens with the argument `max_new_tokens`.

> [!TIP]
> ✏️ **Try it out!** Use the `num_return_sequences` and `max_length` arguments to generate two sentences of 15 words each.
> ✏️ **Try it out!** Use the `num_return_sequences` and `max_new_tokens` arguments to generate two sequences with at most 15 new tokens each.

## Using any model from the Hub in a pipeline[[using-any-model-from-the-hub-in-a-pipeline]]

Expand All @@ -163,7 +163,7 @@ from transformers import pipeline
generator = pipeline("text-generation", model="HuggingFaceTB/SmolLM2-360M")
generator(
"In this course, we will teach you how to",
max_length=30,
max_new_tokens=30,
num_return_sequences=2,
)
```
Expand Down
Loading