Error 401 Client Error: Unauthorized for url

I am getting the same error for a private model (my own) on one machine, but I don’t get the error on another machine. I have checked the versions of transformers and huggingface_hub and they are both same. I also tried with and without the ‘huggingface_hub login’ and the error persists. The exact error I get is

RepositoryNotFoundError: 401 Client Error: Repository not found for url: https://huggingface.co/maveriq/mymodel/resolve/main/modelling_mymodel.py. If the repo is private, make sure you are authenticated.

However as stated earlier in the thread, I can open the url.
huggingface-hub 0.10.1
transformers 4.24.0

Update : While I was posting this, I downgraded huggingface_hub to 0.9.1 and transformers to 4.22.2, and it worked on the machine where earlier I was getting the above stated error