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

inference.py only translating one time although "num_translations_per_input": 20 #161

Open
M0rica opened this issue Jul 1, 2020 · 2 comments

Comments

@M0rica
Copy link

M0rica commented Jul 1, 2020

This is not really a bug, i was just wondering why inference.py is only translating my input one time even though "num_translations_per_input" in hparams is 20. Because of that, the model allways respons with the same answer to the same input. The model is trained on ~12 million reddit pairs. Why is this and is there a solution to this? Thanks

@Nathan-Chell
Copy link

I'm gonna copy and paste what I wrote on a more recent post asking the same thing:

Inference.py returns the highest scoring response. If you look in inference.py you will see a line at the bottom that mentions max (Not at my pc rn cannot confirm line number), that is returning the highest score. If you want to print all responses you'll have to change this section of code.

Hope this helps.

@aditya543
Copy link

Hey everyone! I finally solved this issue after doing a lot of R&D on the nmt package. The reason why your chatbot produces only one response is due to the hyper-parameter: 'infer-mode' set to 'greedy'. Go to setup/settings.py and in the hparams dict add a new key: 'infer-mode' and set it to 'beam-search'. This will solve your issue, thanks!
Check out the image below.

Screen Shot 2022-06-19 at 3 09 08 PM

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

No branches or pull requests

3 participants