Skip to content

Commit

Permalink
clip/openai_clip.py -> clip/openai.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rwightman committed Mar 30, 2022
1 parent 2e8f3a4 commit db8f6df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/clip/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .factory import create_model_and_transforms
from .loss import ClipLoss
from .model import CLIP, CLIPTextCfg, CLIPVisionCfg, convert_weights_to_fp16
from .openai_clip import load_openai
from .openai import load_openai
from .pretrained import list_pretrained, list_pretrained_tag_models, list_pretrained_model_tags,\
get_pretrained_url, download_pretrained
from .tokenizer import SimpleTokenizer, tokenize
Expand Down
2 changes: 1 addition & 1 deletion src/clip/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import torch

from .openai_clip import load_openai
from .model import CLIP, convert_weights_to_fp16
from .openai import load_openai
from .pretrained import get_pretrained_url, download_pretrained
from .transform import image_transform

Expand Down
4 changes: 2 additions & 2 deletions src/clip/openai_clip.py → src/clip/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def load_openai(
if str(device) == "cpu":
model.float()
return model, \
image_transform(model.visual.image_size, is_train=True), \
image_transform(model.visual.image_size, is_train=False)
image_transform(model.visual.image_size, is_train=True), \
image_transform(model.visual.image_size, is_train=False)

# patch the device names
device_holder = torch.jit.trace(lambda: torch.ones([]).to(torch.device(device)), example_inputs=[])
Expand Down

0 comments on commit db8f6df

Please sign in to comment.