MCPcopy Create free account
hub / github.com/Gadersd/stable-diffusion-burn / save_clip_encoder_layer

Function save_clip_encoder_layer

python/clip.py:18–23  ·  view source on GitHub ↗
(clip_encoder_layer, path)

Source from the content-addressed store, hash-verified

16 save_scalar(clip_attention.num_heads, 'n_head', path)
17
18def save_clip_encoder_layer(clip_encoder_layer, path):
19 pathlib.Path(path).mkdir(parents=True, exist_ok=True)
20 save_clip_attention(clip_encoder_layer.self_attn, pathlib.Path(path, 'attn'))
21 save_layer_norm(clip_encoder_layer.layer_norm1, pathlib.Path(path, 'attn_ln'))
22 save_clipmlp(clip_encoder_layer.mlp, pathlib.Path(path, 'mlp'))
23 save_layer_norm(clip_encoder_layer.layer_norm2, pathlib.Path(path, 'mlp_ln'))
24
25def save_clip_encoder(clip_encoder, path):
26 pathlib.Path(path).mkdir(parents=True, exist_ok=True)

Callers 1

save_clip_encoderFunction · 0.85

Calls 3

save_clip_attentionFunction · 0.85
save_layer_normFunction · 0.85
save_clipmlpFunction · 0.85

Tested by

no test coverage detected