Torchhub: automatically disambiguate ref if it's both a branch and a tag (#74418)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/74418
Test Plan: Imported from OSS
Reviewed By: anjali411
Differential Revision: D35008926
Pulled By: NicolasHug
fbshipit-source-id: bdd8aad958d7662cd67556810bfc18b2d7e57fe8
(cherry picked from commit 3aa117a3c32174fa9c61b4eb3a06b314c776a344)