Open
Description
In ch 1.3 Transformers: What can they do, the first example under "Using any model from the Hub in a pipeline" gives an error because the model by default is using Greedy Decoder and hence cannot generate 2 sequences. Here is the current example code:
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,
num_return_sequences=2,
)
Suggestion: Include num_beams or do_sampling=True
Metadata
Metadata
Assignees
Labels
No labels