Text Generation output keep repeat input sentences. Am I missing somethings
I use gpt2 train them by some dataset save it to local model.When I use it its keep repeating the inputScreenshot 2023-11-06 101226708×517 25.4 KBimport torch
from transformers import pipeline

generator = pipeline(
    "text-generation", 
    model="./boba", 
    torch_dtype=torch.bfloat16, 
    device_map="auto"
    )
outputs = generator(
    "Hello, I'm a language model,", 
    max_length=30, 
    num_return_sequences=5,
    repetition_penalty=2.0
    )

for o in outputs:
    print(o)

print("\n")
2024-05-27T20:35:53Z
Have you found any solution? I’m facing the same problem. However, I’m using vicuna instead
2024-05-31T13:00:22Z
Not sure. I’ve change model to DialogGPT
2024-05-31T13:04:57Z
Hi,By default greedy decoding is used and text generation is deterministic. You can pass thedo_sampleflag to the generator to get non-deterministic behaviour.See this blog post for an overview:How to generate text: using different decoding methods for language generation with Transformers