huggingface / transformers

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

Trainer.model.push_to_hub() does not allow a private repository flag #32909

Open qzc438 opened 1 month ago

qzc438 commented 1 month ago

System Info

As the title described.

Who can help?

No response

Information

Tasks

Reproduction

Use the function Trainer.model.push_to_hub().

Expected behavior

Trainer.model.push_to_hub() allows a private repository flag.

amyeroberts commented 1 month ago

Hi @qzc438, thanks for opening this issue!

The easiest way to enable this is to set hub_private_repo=True in TrainingArgs.

I would be nice to have this as a flag in the method too. Would you like to open a PR to add this? cc @muellerzr

qzc438 commented 1 month ago

Dear team,

Can you check this link: https://github.com/huggingface/transformers/issues/25219 From what I can see, hub_private_repo=True is not working.

Sincerely, Zhangcheng Qiang

amyeroberts commented 1 month ago

Hi @qzc438,

Could you run the example code from this comment and confirm if it works?

I was unable to reproduce the reported issue in #25219. If you can provide an minimal code snippet which reproduces hub_private_repo=True not working and your environment information then we can try and dig into it

qzc438 commented 1 month ago

Dear team,

I am trying to, but I cannot find a way to track the visibility of the hugging face models in the audit log. I have tried your enterprise version, but this information is still untrackable.

Sincerely, Zhangcheng Qiang

On Tue, 27 Aug 2024 at 20:49, amyeroberts @.***> wrote:

Hi @qzc438 https://github.com/qzc438,

Could you run the example code from this comment https://github.com/huggingface/transformers/issues/25219#issuecomment-1668408539 and confirm if it works?

I was unable to reproduce the reported issue in #25219 https://github.com/huggingface/transformers/issues/25219. If you can provide an minimal code snippet which reproduces hub_private_repo=True not working and your environment information then we can try and dig into it

— Reply to this email directly, view it on GitHub https://github.com/huggingface/transformers/issues/32909#issuecomment-2312187692, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVDZBHVTA3CQ5WSB25XF7TZTRKT3AVCNFSM6AAAAABM3IYLBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJSGE4DONRZGI . You are receiving this because you were mentioned.Message ID: @.***>

amyeroberts commented 1 month ago

Hi @qzc438, are you referring to these? Is this related to this issue?

qzc438 commented 1 month ago

Yes, I am not sure whether the audit log provides the function to check visibility.

amyeroberts commented 1 month ago

By visibility, do you mean whether the created repo is public or private?

qzc438 commented 1 month ago

Yes, you are right.

amyeroberts commented 1 month ago

I'm not super familiar with the audit logs - however I think they're centered around recording actions and activity of users.

For a given repo and its name, you should be able to see directly on the hub whether it's private e.g. for a repo of mine

Screenshot 2024-08-28 at 12 36 25
qzc438 commented 1 month ago

Yes, I see. The main point is that once you set the repository to private or public during creation, any changes in the code will not reflect the visibility. I tried to use the audit log to check if any intermediate changes happened.

amyeroberts commented 1 month ago

once you set the repository to private or public during creation, any changes in the code will not reflect the visibility

@qzc438 Just to be clear and make sure I understand the behaviour you're describing are you saying that:

Is this correct?

qzc438 commented 1 month ago

Yes, you are correct. Also, if you create a private repository, it cannot change to the public by running the code hub_private_repo=False.

amyeroberts commented 1 month ago

OK, I see. Yes, this behaviour is expected. The arguments controlling if a repo is private or not, only apply to the repo's creation.