-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
adding trust_remote_code argument for loading dataset in controlnet traininig example #10727
base: main
Are you sure you want to change the base?
Conversation
needed for the controlnet example with fusing/fill50k
trust_remote_code=True for fusing/fill50k
Hi, thanks for your contribution, can you help me understand why is this needed? do you have a use case for enabling remote code inside a dataset? Also it should be False by default not True, so only people that needs it and know what they're doing can use it and enable it. |
Hi, Thank you for reviewing my pull request. I followed the instructions in the README for training ControlNet with the fill50k circles dataset on my multi-GPU setup. During this process, I encountered a prompt asking if I trust_remote_code (actually multiple identical prompt for each gpu). Due to this multiprocessing, I couldn't respond 'yes' to the prompt which was the result of a remote code on the dataset side. Considering this example is specific to the fill50k dataset, I assumed setting trust_remote_code=True by default was appropriate. |
oh I see, I still haven't had the opportunity to train a ControlNet, so I didn't know that the demo and that dataset need the remote code, its weird that people didn't open this issue before, ccing @sayakpaul since I don't have enough experience with this yet. |
@YanivDorGalron thanks for your PR. Could you show us for which ControlNet checkpoint this is useful? |
Hi @sayakpaul , I run
|
That checkpoint should be well supported. I don't understand why do we need |
The |
) | ||
else: | ||
if args.train_data_dir is not None: | ||
dataset = load_dataset( | ||
args.train_data_dir, | ||
cache_dir=args.cache_dir, | ||
trust_remote_code=args.trust_remote_code |
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.
I guess we could condition this by checking if we're using the fill-50k dataset otherwise it looks like a bit security-harming.
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.
We could set the default to be false but write the correct command in the readme. (which is speciific for fill50k). does that sound appropriate?
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.
Sounds perfect to me! Thanks so much!
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.
I have made the suggested modification.
now at every command where fill50k is used a new flag argument was added:
--dataset_name=fusing/fill50k \
--trust_remote_code \
in addition i made the needed modification for the relevant py
files to include the argument
its a store_true
argument therefore by default is False
.
…de in the command. store_true argument therefore default is false.
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.
Thank you so much!
@YanivDorGalron can you run |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
These commands modify files unrelated to this PR. Should I proceed with pushing those changes as well?
|
You can only add |
done! |
@sayakpaul I noticed that the PR failed some tests. I'm not sure if the failures are related to my changes— is there anything I can do on my end? |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
changes mode to both the readme and the train_controlnet.py example