Commit 531c55b2 authored by mashun1's avatar mashun1
Browse files

Update modules.py

parent ca649a3f
...@@ -147,7 +147,7 @@ class FrozenOpenCLIPEmbedder(AbstractEncoder): ...@@ -147,7 +147,7 @@ class FrozenOpenCLIPEmbedder(AbstractEncoder):
assert layer in self.LAYERS assert layer in self.LAYERS
# 修改读取路径 # 修改读取路径
model_path = Path(__file__).resolve().parent.parent.parent / "models" / "open_clip_pytorch_model.bin" model_path = Path(__file__).resolve().parent.parent.parent.parent / "models" / "open_clip_pytorch_model.bin"
model, _, _ = open_clip.create_model_and_transforms(arch, device=torch.device('cpu'), pretrained=str(model_path)) model, _, _ = open_clip.create_model_and_transforms(arch, device=torch.device('cpu'), pretrained=str(model_path))
del model.visual del model.visual
self.model = model self.model = model
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment