Username case sensitivity causing model push failure on the hub

I don’t know if this is a bug, so I just posted it here to avoid cluttering up the issues on GitHub.
My username is A2va, but if I go to the hugginface.co/a2va it redirect to https://huggingface.co/A2va

But that doesn’t seem to be the case when pushing a model to the hub. For example the first snippet is failing, by throwing a exception “token doesn’t have the write permission”.

repo_id = "a2va/openbuddy-llama3.1-8b-bnb-4bit"
model.push_to_hub(repo_id, token=token)

But with the capitalized a it works.

repo_id = "A2va/openbuddy-llama3.1-8b-bnb-4bit"
model.push_to_hub(repo_id)

This is a delicate case.
As a rule, HF user names and repo names are case-sensitive.
The redirection is probably just a friendly feature.
If HF does that with uploads at the Hub, the worst that can happen is access to someone else’s repo with a similar name.
I would probably be safer with this spec as it is, but at least a Warning or a Maybe, for example, would be acceptable. I’ll leave it to you to decide if you want to report it or not.

P.S.
I recall that the case may be redirected, for example, if he/she renamed his/her username after creation. Maybe that is the case.

https://huggingface.co/sd-legacy/stable-diffusion-v1-5

↓redirect

https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5

If HF does that with uploads at the Hub, the worst that can happen is access to someone else’s repo with a similar name.

I didn’t think of those implications, maybe you’re right it’s better to leave it like that.

Yes, it is. I can’t think of any improvement ideas to get them to do something about it. Let’s leave it alone.