Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7166ad6

Browse files
authored
add open clip to train_config (lucidrains#260)
add the ability to use open_clip in the train configs (useful for the new SOTA h/14 model)
1 parentfbba0f9 commit7166ad6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎dalle2_pytorch/train_configs.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
fromtypingimportList,Optional,Union,Tuple,Dict,Any,TypeVar
55

66
fromx_clipimportCLIPasXCLIP
7+
fromopen_clipimportlist_pretrained
78
fromcoca_pytorchimportCoCa
89

910
fromdalle2_pytorch.dalle2_pytorchimport (
1011
CoCaAdapter,
1112
OpenAIClipAdapter,
13+
OpenClipAdapter,
1214
Unet,
1315
Decoder,
1416
DiffusionPrior,
@@ -117,6 +119,10 @@ class AdapterConfig(BaseModel):
117119
defcreate(self):
118120
ifself.make=="openai":
119121
returnOpenAIClipAdapter(self.model)
122+
elifself.make=="open_clip":
123+
pretrained=dict(list_pretrained())
124+
checkpoint=pretrained[self.model]
125+
returnOpenClipAdapter(name=self.model,pretrained=checkpoint)
120126
elifself.make=="x-clip":
121127
returnXClipAdapter(XCLIP(**self.base_model_kwargs))
122128
elifself.make=="coca":

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp