MCPcopy
hub / github.com/jindongwang/transferlearning / load_model

Function load_model

code/clip/test_clip.py:73–76  ·  view source on GitHub ↗
(modelname)

Source from the content-addressed store, hash-verified

71
72
73def load_model(modelname):
74 device = "cuda" if torch.cuda.is_available() else "cpu"
75 model, preprocess = clip.load(modelname, device)
76 return model, preprocess
77
78
79def classify_imagenetr(imagenet_r, imagenetr_labels, model, preprocess, device):

Callers 2

perform_inferenceFunction · 0.70
testFunction · 0.70

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected