Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am getting repetitive output when running "python run_generation.py" #2322

Closed
sunshinelala1991 opened this issue Dec 26, 2019 · 3 comments
Closed
Labels

Comments

@sunshinelala1991
Copy link

❓ Questions & Help

Here is the command I used to run the code:
python run_generation.py --model_type=gpt2 --model_name_or_path=gpt2 --length 100
Here is the input and output I got:
Model prompt >>> nice to meet you
nice to meet you.

"I'm sorry, but I'm not going to be able to meet you. I'm not going to be able to meet you. I'm not going to be able to meet you. I'm not going to be able to meet you. I'm not going to be able to meet you. I'm not going to be able to meet you. I'm not going to be able to meet you. I'm not going to be able to meet!

I have tried different inputs but the output is always repeated.

@shashankMadan-designEsthetics

I guess you can tune the model for better results like selecting medium large gpt model changin temp and top - p to get different predictions.
If your new try using write with transformer to get an idea about it.

@patrickvonplaten
Copy link
Contributor

You could add a repetition_penalty. Running
python run_generation.py --model_type=gpt2 --model_name_or_path=gpt2 --length=100 --repetition_penalty=1.2

would give:

Model prompt >>> nice to meet you
nice to meet you.
I'm sorry, but I don't know what's going on here." She said with a smile that made me feel like she
was trying hard to be nice and not mean or anything… "You're just saying it because we've been 
together for so long…" Her voice sounded very serious as if someone had asked her about the past 
couple of days before they'd met up in person at all!

You would need a very up-to-date version of transformers to make sure that the PR #2303 is included in your code to be sure that the repetition_penalty is working correctly.

@stale
Copy link

stale bot commented Feb 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants