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

Fix translate.py bug (OpenNMT/OpenNMT-py#1317) #1318

Merged
merged 1 commit into from
Feb 24, 2019

Conversation

fdalvi
Copy link
Contributor

@fdalvi fdalvi commented Feb 21, 2019

translate.py would ignore all sentences after processing shard_size*shard_size sentences in src, if no tgt file was provided. This commit fixes this issue (#1317).

I've run all the tests as well, but none of them seem to actually target translate.py. I tested it manually using the following parameters on a ~1000 line source file:

python  translate.py --model model_step_10000.pt --src 1000-line-test.txt --batch_size 1 --shard_size 1 --output pred1.txt
python  translate.py --model model_step_10000.pt --src 1000-line-test.txt --batch_size 1 --output pred2.txt
python  translate.py --model model_step_10000.pt --src 1000-line-test.txt --output pred3.txt
python  translate.py --model model_step_10000.pt --src 1000-line-test.txt --batch_size 1 --shard_size 10 --output pred4.txt
python  translate.py --model model_step_10000.pt --src 1000-line-test.txt --batch_size 10 --shard_size 1 --output pred5.txt

All outputs were identical. If you'd like me to run more tests, let me know!

`translate.py` would ignore all sentences after processing
`shard_size*shard_size` sentences in `src`, if no `tgt` file
was provided. This commit fixes this.
@vince62s vince62s merged commit 052954d into OpenNMT:master Feb 24, 2019
ItaySofer pushed a commit to ItaySofer/OpenNMT-py that referenced this pull request Mar 17, 2019
`translate.py` would ignore all sentences after processing
`shard_size*shard_size` sentences in `src`, if no `tgt` file
was provided. This commit fixes this.
ItaySofer pushed a commit to ItaySofer/OpenNMT-py that referenced this pull request Mar 17, 2019
`translate.py` would ignore all sentences after processing
`shard_size*shard_size` sentences in `src`, if no `tgt` file
was provided. This commit fixes this.
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