dmarx / Multi-Modal-Comparators

Unified API to facilitate usage of pre-trained "perceptor" models, a la CLIP
39 stars 4 forks source link

wrap loader to mock CLIP.clip module #30

Closed dmarx closed 2 years ago

dmarx commented 2 years ago

to facilitate loading preprocessor/tokenizer more naturally

ldr = REGISTRY.find(id='my-model")
clip = MockClipModule(ldr)

tokenizer = clip.tokenize
model, preprocess_image = clip.load('my-model')