Model loading gets stuck when calling "from_pretrained"

Hi, when I use the GroundingDino from the huggingface, the model loading is always got stuck when calling the “from_pretrained(model_id)”. The issue happens today and before I have not met this kind of issue and the loading process is normal.

I tried to switch different version of “transformers” library and also deleted the local downloaded files for several times. But all of these don’t work. I also tried this on another machine, this weird issue will not happen. Could you please give me some suggestions to solve this?

The code I used is from the official repo:

import requests
import torch
from PIL import Image
from transformers import AutoProcessor, AutoModelForZeroShotObjectDetection 

model_id = "IDEA-Research/grounding-dino-base"
device = "cuda" if torch.cuda.is_available() else "cpu"

processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(device)

image_url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(image_url, stream=True).raw)
1 Like

It is a really strange problem. I don’t see anything particularly odd in your code or in the repo.
The last commit to this model repo was in May, and I don’t think it has anything to do with the problem.
Do you get the same symptoms with other models?