Hi May I know why the hugging face is saying we dont have the access but actually we have been approved?
Hi, thanks for this amazing work!
Previously we have applied and got approved, in the webpage it says:
Gated model You have been granted access to this model
However, in the python downloading, it says:
Cannot access gated repo for url https://huggingface.co/MahmoodLab/UNI/resolve/main/config.json.
Access to model MahmoodLab/UNI is restricted. You must have access to it and be authenticated to access it. Please log in.
But actually I have loged in with my token.
I heard my collegues also have the same issue with UNI, may I raise this issue for your further notice? Thanks!
and I find manually build the model and then use huggingface weight is ok:
api_token = os.environ["HF_TOKEN"]
Download the model weights
model_weights_path = hf_hub_download(repo_id="MahmoodLab/UNI", filename="pytorch_model.bin", use_auth_token=api_token)
Load the model using timm and the downloaded weights
Create the ViT model using the configuration from Hugging Face
model = timm.create_model(
"vit_large_patch16_224", # Model architecture
pretrained=True, # Load pretrained weights
img_size=224, # Image size is 224x224
num_classes=0, # No classification head (feature extractor mode)
init_values=1.0, # Layer scale initialization value
global_pool="token", # Use token pooling (default for ViT)
dynamic_img_size=True # Allow dynamic image size
)
model.load_state_dict(torch.load(model_weights_path))