-
Notifications
You must be signed in to change notification settings - Fork 5
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
Generic downstream eval #160
Conversation
- Added test for checkpoint conversion.
- In process of adapting HuggingFaceAdapterConfig for loading the saved HF model.
- In process of adapting HuggingFaceAdapterConfig for loading the saved HF model.
- Adapted HuggingFaceAdapterModel for loading the saved HF model.
- Adapted HuggingFaceAdapterModel for loading the saved HF model.
… HF adapters for eval harness
- fixed end point for checkpoint conversion
…dels - test cases added for gpt2 and mamba - only one single HFAdapter and HFAdapterConfig - added gpt2 config example yaml file for testing
- type hints added - comments in toml deleted
- loading a model with registry is now in models/utils.py - both tests and hf_adapter call util method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good work and awesome that you guys found a generic solution to it! :-) Thanks a lot for digging deep into the huggingface source code!
I left a few remarks here and there that you should address but overall the solution is great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good work and awesome that you guys found a generic solution to it! :-) Thanks a lot for digging deep into the huggingface source code!
I left a few remarks here and there that you should address but overall the solution is great!
- Add missing type hints - consolidate code - refactor tests - shorten test configs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR is almost in a mergable state. I found one potential bug with the PosixPath to string conversion. And some minor things that I think should be addressed before merging. Other than that it's in a great state and we should be able to merge after including the requested changes and another person has reviewed it :-)
- Added type hints in test_checkpoint_conversion.py and hf_adapter.py - Added ConfigError in exceptions.py - Fixed the bug in forward() in hf_adapter.py where the return_dict condition was returning wrong data type. - Converted model_type in utils.py from str to Enum. - Added back the test to check the output of the model before and after conversion.
- Bug fix in convert_posixpath_to_str() for list values. - Added test for convert_posixpath_to_str() - Changed _convert_posixpath_to_str() to convert_posixpath_to_str()
- Added type arguments to the fixture arguments in test_checkpoint_conversion.py - Changed back convert_posixpath_to_str() to _convert_posixpath_to_str()
Added prediction_key argument in the convert_pytorch_to_hf_checkpoint end point
…ities into generic-downstream-eval
Changed this back. It was not a bug. Huggingface requires the output in the particular format when return_dict = True
Fixed the issue where the config of checkpointed model still needs checkpointed_model key and used the non-converted checkpoint in Eval Harness.
Addressed the PR comments
…ities into generic-downstream-eval
What does this PR do?
We can now convert a modalities model into a HF model. This model can then be evaluated in eval harness.
convert_pytorch_to_hf_checkpoint
endpoint that takes themodel_name
,model_config_path
andoutput_dir
and creates HF files that can then be loaded withAutoModel.from_pretrained
General changes
Breaking Changes
Checklist before submitting final PR
python tests/tests.py
)