-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Save ludwig-config with model-weights in output directory #3965
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
Save ludwig-config with model-weights in output directory #3965
Conversation
for more information, see https://pre-commit.ci
…ights' into save-ludwig-config-with-model-weights
|
Hi @alexsherstinsky , this submission is now ready for your review. |
Hi @sanjaydasgupta -- in order to make a pull request ready for review, please click the button "Ready for review" -- then a number of people will be able to review it and offer their thoughts. Thank you very much! |
|
Sanjay can you help me understand the reson for this? The config is already in the output directory, not sure why you need to add it one more time. |
…ights' into save-ludwig-config-with-model-weights
|
Hi @alexsherstinsky please take a look at my updates. Thank you. |
for more information, see https://pre-commit.ci
I will fix the build errors my morning. Thanks! |
alexsherstinsky
left a comment
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.
LGTM! @sanjaydasgupta -- very nicely done! Thank you so much for this contribution!
Once all the tests pass, please feel free to merge. Yay!
alexsherstinsky
left a comment
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.
Let us wait to make sure that all tests pass. Thank you.
…ights' into save-ludwig-config-with-model-weights
for more information, see https://pre-commit.ci
…or presence of 'model_hyperparameters.json' test_upload_utils.py: augmented '_build_fake_model_repo()' to add 'model_hyperparameters.json' at expected location
…ights' into save-ludwig-config-with-model-weights
for more information, see https://pre-commit.ci
…ights' into save-ludwig-config-with-model-weights
This PR adds a boolean parameter
save_ludwig_config_with_model_weightsto the API'strain()andexperiment()methods that allows the caller to indicate that the user-provided ludwig-configuration should be added to the output directory (along with the model weights). When this parameter is set toTrue, a file namedludwig_config.jsonis added to the output directory. The ludwig config will thus be uploaded to HF along with the model weights whenever the API'supload_to_hf_hub()is called. Thesave_ludwig_config_with_model_weightsparameter has aFalsedefault, so the feature will not affect pre-existing code or behavior. Enabling users to share or reproduce each other's results is important in many contexts, so publishing the Ludwig config along with a fine-tuned model's weights on HF will be a helpful.This PR implements this issue.
This feature can be tested by the new integration test
def test_ludwig_config_save(save_ludwig_config_with_model_weights, tmp_path)in test_model_training_options.py