Skip to content

Update max_length to max_new_tokens in Chapter 1 3.mdx#986

Open
Diyasingh03 wants to merge 2 commits into
huggingface:mainfrom
Diyasingh03:patch-1
Open

Update max_length to max_new_tokens in Chapter 1 3.mdx#986
Diyasingh03 wants to merge 2 commits into
huggingface:mainfrom
Diyasingh03:patch-1

Conversation

@Diyasingh03

Copy link
Copy Markdown

docs: Update text generation examples to use max_new_tokens

Replace max_length with max_new_tokens in the pipeline("text-generation", ...) example within the LLM course documentation. This aligns with recommended best practices for controlling the generated output length and provides a clearer demonstration for users.

generator(
"In this course, we will teach you how to",
max_new_tokens=30, # Use max_new_tokens here
num_return_sequences=2,
)

docs: Update text generation examples to use max_new_tokens

Replace `max_length` with `max_new_tokens` in the `pipeline("text-generation", ...)` example within the LLM course documentation. This aligns with recommended best practices for controlling the generated output length and provides a clearer demonstration for users.

generator(
    "In this course, we will teach you how to",
    max_new_tokens=30,  # Use max_new_tokens here
    num_return_sequences=2,
)
@Diyasingh03 Diyasingh03 changed the title Update max_length to max_new_tokens in 3.mdx Update max_length to max_new_tokens in Chapter 1 3.mdx Jul 1, 2025
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

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