huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
132.15k stars 26.33k forks source link

add `private` parameter to trainer.push_to_hub #33492

Open not-lain opened 3 days ago

not-lain commented 3 days ago

Feature request

Adding another parameter to the trainer.push_to_hub called private

Motivation

a user at https://discuss.huggingface.co/t/how-to-push-trained-models-and-save-it-privately-on-hub/25538/10 has requested this, and although setting hub_private_repo training argument to True is a good alternative, but I agree with them on the basis that we need a unified push_to_hub method.

Your contribution

I can submit a PR

RylanSchaeffer commented 3 days ago

@not-lain thanks for making this. Let me know if you want me to do this or if you want any help :)

not-lain commented 3 days ago

Honestly, I'm a bit overwhelmed lately and I could use some help. Feel free to open a PR and tag me and I'll see if I have any reviews. I was thinking of doing something like this to ensure backward compatibility

def push_to_hub(...,private=None,...) : 
   if private is not None : 
       self.args.hub_private_repo = private

but feel free to ignore this and build it your own way. Thanks in advance