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

Small modification to enable usage by external scripts #956

Merged
merged 2 commits into from
Oct 26, 2022

Conversation

briancw
Copy link
Contributor

@briancw briancw commented Oct 23, 2022

This change enables dreambooth training to be called by an external script. This makes it much easier to write wrappers around training for GUI's or batch processing scripts. This change does not break existing usage.

Add parameter inputs to training and argument parsing function to allow this script to be used by an external call.
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 23, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine for me - @patil-suraj what do you think?

@@ -312,8 +316,7 @@ def get_full_repo_name(model_id: str, organization: Optional[str] = None, token:
return f"{organization}/{model_id}"


def main():
args = parse_args()
def train(args):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say let's not change this

Copy link
Contributor

@patil-suraj patil-suraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks a lot for the PR! Just left one comment, let's not change the function name from main to train for consistency with our other scripts.

@patrickvonplaten patrickvonplaten merged commit d3d22ce into huggingface:main Oct 26, 2022
@ssotabe
Copy link

ssotabe commented Oct 27, 2022

Hi,
If I try to activate this code in the conventional way, it will not work.

Traceback (most recent call last):
  File "train_dreambooth.py", line 659, in <module>
    args = parse_args()
TypeError: parse_args() missing 1 required positional argument: 'input_args'

def parse_args( input_args ):def parse_args( input_args=None ):
Rewriting this code appears to work fine.

@patil-suraj
Copy link
Contributor

Good catch @ssotabe , fixed in #1017

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.

5 participants