Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Serialized with:
|
2 |
+
|
3 |
+
```python
|
4 |
+
import torch
|
5 |
+
from transformers import CLIPTextConfig, CLIPTextModelWithProjection
|
6 |
+
|
7 |
+
def get_dummy_components():
|
8 |
+
clip_text_encoder_config = CLIPTextConfig(
|
9 |
+
bos_token_id=0,
|
10 |
+
eos_token_id=2,
|
11 |
+
hidden_size=32,
|
12 |
+
intermediate_size=37,
|
13 |
+
layer_norm_eps=1e-05,
|
14 |
+
num_attention_heads=4,
|
15 |
+
num_hidden_layers=5,
|
16 |
+
pad_token_id=1,
|
17 |
+
vocab_size=1000,
|
18 |
+
hidden_act="gelu",
|
19 |
+
projection_dim=32,
|
20 |
+
)
|
21 |
+
|
22 |
+
torch.manual_seed(0)
|
23 |
+
text_encoder = CLIPTextModelWithProjection(clip_text_encoder_config)
|
24 |
+
|
25 |
+
torch.manual_seed(0)
|
26 |
+
text_encoder_2 = CLIPTextModelWithProjection(clip_text_encoder_config)
|
27 |
+
|
28 |
+
return text_encoder, text_encoder_2
|
29 |
+
|
30 |
+
|
31 |
+
text_encoder, text_encoder_2 = get_dummy_components()
|
32 |
+
text_encoder.push_to_hub("hf-internal-testing/tiny-sd3-text_encoder")
|
33 |
+
text_encoder_2.push_to_hub("hf-internal-testing/tiny-sd3-text_encoder-2")
|
34 |
+
```
|