convert : partially revert PR #4818 #5041
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR #3633 made some significant changes to convert.py. PR #4818 refactored this code, and also made a lot of intertwined style changes.
This PR attempts to find a middleground between the original convert.py, convert.py after PR 3633, and convert.py after PR 4818, by reverting any of the changes that seemed unnecessary.
If you search for convert.py here, you will see the full diff between convert.py before PR 3633, and convert.py on this PR. Notice that it is relatively small - only 287 insertions and 84 deletions, including AWQ and --padvocab. Compare that to PR 4818 as merged - 675 insertions and 312 deletions, just for that PR on its own.
teleprint-me, please don't take this the wrong way. But I believe there should be more discussion before making broad changes to the style and structure of code like this. PR 4818 didn't get that opportunity because it fixed an important issue, but I am not satisfied with the outcome.
Also fixes #4631 as a bonus, and fixes the complaints from mypy and pytype.