Fix export_dcp.py bugs #251
Open
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.
This pull request introduces improvements to the model export process and checkpoint handling. The key updates include simplifying the
get_modelfunction call, ensuring shard count is at least 1, and enabling the use ofcloudpicklefor saving and loading checkpoint files to enhance serialization flexibility.Model Export Improvements:
get_modelfunction call by passing theconfigobject and tokenizer length directly, reducing the number of parameters. (scripts/export_dcp.py, scripts/export_dcp.pyL138-R139)num_shards) is at least 1 to avoid potential zero-shard errors. (scripts/export_dcp.py, scripts/export_dcp.pyL165-R162)Checkpoint Handling Enhancements:
cloudpickleas thepickle_modulefortorch.saveandtorch.loadoperations, improving serialization support for complex objects. (src/zeroband/checkpoint.py, [1] [2] [3] [4] [5]self.loggerwithself._loggerin thedelete_topkcall to align with the correct attribute name. (src/zeroband/checkpoint.py, src/zeroband/checkpoint.pyL357-R358)