BiliSakura commited on
Commit
eec0aa0
·
verified ·
1 Parent(s): 5fd7430

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -1,3 +1,50 @@
1
- ---
2
- {}
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RSEdit-DiT-Modified
2
+
3
+ Local diffusers-compatible checkpoint with custom pipeline code.
4
+
5
+ ## Default Inference Settings
6
+
7
+ - `torch_dtype=torch.bfloat16`
8
+ - `guidance_scale=4.5`
9
+ - `guidance_interval=(0.0, 1.0)` (default: guidance active for the full denoising schedule)
10
+ - `image_guidance_scale=None` (falls back to `guidance_scale`)
11
+ - `num_inference_steps=50`
12
+ - `clean_caption=False`
13
+
14
+ ## Quick Start
15
+
16
+ ```python
17
+ import torch
18
+ from PIL import Image
19
+ from diffusers import DiffusionPipeline
20
+
21
+ model_dir = "/data/projects/RSEdit/models/BiliSakura/RSEdit-DiT-Modified"
22
+ img_path = "/data/projects/RSEdit/datasets/BiliSakura/RSCC-RSEdit-Test-Split/images/hurricane-florence_00000109_post_disaster_part1.png"
23
+ out_path = "/data/projects/RSEdit/outputs/hurricane-florence_00000109_rsedit_bf16_cfg4p5_seed12345.png"
24
+
25
+ prompt = "Severe flooding engulfed the area, submerging all six buildings up to their rooftops, causing partial wall collapses and significant structural weakening. Vegetation along the shoreline was stripped away by rushing waters, exposing bare earth and debris. Roads near the settlement became impassable due to mudslides and erosion, isolating the community. No intact structures remained visible, with every building classified as majorly damaged (Level 2) under disaster protocols."
26
+
27
+ pipe = DiffusionPipeline.from_pretrained(
28
+ model_dir,
29
+ custom_pipeline=f"{model_dir}/pipeline.py",
30
+ torch_dtype=torch.bfloat16,
31
+ ).to("cuda")
32
+
33
+ print("Pipeline:", pipe.__class__.__name__)
34
+ print("Transformer:", pipe.transformer.__class__.__name__)
35
+
36
+ image = Image.open(img_path).convert("RGB")
37
+ result = pipe(
38
+ prompt=prompt,
39
+ source_image=image,
40
+ num_inference_steps=50,
41
+ guidance_scale=4.5,
42
+ image_guidance_scale=1.5,
43
+ guidance_interval=(0.0, 1.0), # default full-range guidance
44
+ clean_caption=False,
45
+ generator=torch.Generator(device="cuda").manual_seed(12345),
46
+ ).images[0]
47
+
48
+ result.save(out_path)
49
+ print("Saved:", out_path)
50
+ ```
__pycache__/pipeline.cpython-312.pyc ADDED
Binary file (34 kB). View file
 
checkpoint-30000/optimizer.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9fc99fa72f29f480affe3bddefa65897f47e3ac74f866fe261a735776526fe31
3
+ size 9793028887
checkpoint-30000/random_states_0.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3b2b6af81e217acd088d5923355a41fdba319dea5b1a6d62e94d100961a73bc
3
+ size 15537
checkpoint-30000/scheduler.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71a93e7f6752b4aef5269f5c725646a4584b73a104d84e96dba8f0c462ec3477
3
+ size 1465
checkpoint-30000/transformer/config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "ConfiguredRSEditModifiedPixArtTransformer2DModel",
3
+ "_diffusers_version": "0.36.0",
4
+ "_name_or_path": "/data/models/hf_models/PixArt-alpha/PixArt-XL-2-512x512",
5
+ "activation_fn": "gelu-approximate",
6
+ "attention_bias": true,
7
+ "attention_head_dim": 72,
8
+ "attention_type": "default",
9
+ "caption_channels": 4096,
10
+ "cross_attention_dim": 1152,
11
+ "double_self_attention": false,
12
+ "dropout": 0.0,
13
+ "in_channels": 4,
14
+ "interpolation_scale": null,
15
+ "norm_elementwise_affine": false,
16
+ "norm_eps": 1e-06,
17
+ "norm_num_groups": 32,
18
+ "norm_type": "ada_norm_single",
19
+ "num_attention_heads": 16,
20
+ "num_embeds_ada_norm": 1000,
21
+ "num_layers": 28,
22
+ "num_vector_embeds": null,
23
+ "only_cross_attention": false,
24
+ "out_channels": 8,
25
+ "patch_size": 2,
26
+ "rsedit_modified_dit": true,
27
+ "rsedit_window_size": 8,
28
+ "rsedit_window_skip_every": 1,
29
+ "sample_size": 64,
30
+ "upcast_attention": false,
31
+ "use_additional_conditions": null,
32
+ "use_linear_projection": false
33
+ }
checkpoint-30000/transformer/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9d3c1f951f58ab1024b6bb4dd9da4331404194573e13949f3d204c4a54e3085
3
+ size 2448140648
logs/rsedit-dit/1777865962.360141/events.out.tfevents.1777865962.ubuntu22.4001.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c5d44f0052443ba2d4d44f13b19749ba557c8fbcead9f08fa9655f26a05597c
3
+ size 3168
logs/rsedit-dit/1777865962.361632/hparams.yml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ adam_beta1: 0.9
2
+ adam_beta2: 0.99
3
+ adam_epsilon: 1.0e-08
4
+ adam_weight_decay: 0.01
5
+ allow_tf32: false
6
+ cache_dir: null
7
+ center_crop: false
8
+ checkpointing_steps: 10000
9
+ checkpoints_total_limit: 1
10
+ concat_strategy: token
11
+ conditioning_dropout_prob: 0.05
12
+ dataloader_num_workers: 12
13
+ dataset_config_name: null
14
+ dataset_name: null
15
+ edit_prompt_column: edit_prompt
16
+ edited_image_column: edited_image
17
+ enable_xformers_memory_efficient_attention: false
18
+ gradient_accumulation_steps: 4
19
+ gradient_checkpointing: false
20
+ hub_model_id: null
21
+ hub_token: null
22
+ learning_rate: 1.0
23
+ local_rank: 0
24
+ logging_dir: logs
25
+ lr_scheduler: constant
26
+ lr_warmup_steps: 500
27
+ max_grad_norm: 1.0
28
+ max_train_samples: null
29
+ max_train_steps: 30000
30
+ mixed_precision: bf16
31
+ non_ema_revision: null
32
+ num_train_epochs: 16
33
+ num_validation_images: 4
34
+ original_image_column: input_image
35
+ output_dir: /data/projects/RSEdit/models/BiliSakura/RSEdit-DiT-Modified
36
+ pretrained_model_name_or_path: /data/models/hf_models/PixArt-alpha/PixArt-XL-2-512x512
37
+ prodigy_d0: 1.0e-05
38
+ prodigy_d_coef: 1.0
39
+ prodigy_safeguard_warmup: true
40
+ prodigy_use_bias_correction: true
41
+ push_to_hub: false
42
+ random_flip: false
43
+ report_to: tensorboard
44
+ resolution: 512
45
+ resume_from_checkpoint: null
46
+ revision: null
47
+ scale_lr: false
48
+ seed: 42
49
+ train_batch_size: 2
50
+ train_data_dir: /data/data/hf_datasets/BiliSakura/RSCC
51
+ use_8bit_adam: false
52
+ use_ema: true
53
+ use_prodigy: true
54
+ val_annotation_path: /data/data/hf_datasets/BiliSakura/RSCC/RSCC_qvq.jsonl
55
+ val_image_url: null
56
+ val_set_path: /data/data/hf_datasets/BiliSakura/RSCC/val_set.txt
57
+ validation_epochs: 1
58
+ validation_prompt: null
59
+ validation_steps: 0
60
+ variant: null
61
+ window_size: 8
62
+ window_skip_every: 1
logs/rsedit-dit/1777944234.2228265/events.out.tfevents.1777944234.ubuntu22.19227.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9e5eb414ca73533ee3e883a079faa390d9cad9a1cdec862ee9b7f635c7c15da
3
+ size 3232
logs/rsedit-dit/1777944234.2248008/hparams.yml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ adam_beta1: 0.9
2
+ adam_beta2: 0.99
3
+ adam_epsilon: 1.0e-08
4
+ adam_weight_decay: 0.01
5
+ allow_tf32: false
6
+ cache_dir: null
7
+ center_crop: false
8
+ checkpointing_steps: 10000
9
+ checkpoints_total_limit: 1
10
+ concat_strategy: token
11
+ conditioning_dropout_prob: 0.05
12
+ dataloader_num_workers: 12
13
+ dataset_config_name: null
14
+ dataset_name: null
15
+ edit_prompt_column: edit_prompt
16
+ edited_image_column: edited_image
17
+ enable_xformers_memory_efficient_attention: false
18
+ gradient_accumulation_steps: 4
19
+ gradient_checkpointing: false
20
+ hub_model_id: null
21
+ hub_token: null
22
+ learning_rate: 1.0
23
+ local_rank: 0
24
+ logging_dir: logs
25
+ lr_scheduler: constant
26
+ lr_warmup_steps: 500
27
+ max_grad_norm: 1.0
28
+ max_train_samples: null
29
+ max_train_steps: 30000
30
+ mixed_precision: bf16
31
+ non_ema_revision: null
32
+ num_train_epochs: 16
33
+ num_validation_images: 4
34
+ original_image_column: input_image
35
+ output_dir: /data/projects/RSEdit/models/BiliSakura/RSEdit-DiT-Modified
36
+ pretrained_model_name_or_path: /data/models/hf_models/PixArt-alpha/PixArt-XL-2-512x512
37
+ prodigy_d0: 1.0e-05
38
+ prodigy_d_coef: 1.0
39
+ prodigy_safeguard_warmup: true
40
+ prodigy_use_bias_correction: true
41
+ push_to_hub: false
42
+ random_flip: false
43
+ report_to: tensorboard
44
+ resolution: 512
45
+ resume_from_checkpoint: latest
46
+ revision: null
47
+ scale_lr: false
48
+ seed: 42
49
+ train_batch_size: 2
50
+ train_data_dir: /data/data/hf_datasets/BiliSakura/RSCC
51
+ use_8bit_adam: false
52
+ use_ema: true
53
+ use_prodigy: true
54
+ val_annotation_path: /data/data/hf_datasets/BiliSakura/RSCC/RSCC_qvq.jsonl
55
+ val_image_url: null
56
+ val_set_path: /data/data/hf_datasets/BiliSakura/RSCC/val_set.txt
57
+ validation_epochs: 1
58
+ validation_prompt: null
59
+ validation_steps: 0
60
+ variant: null
61
+ window_size: 8
62
+ window_skip_every: 1
logs/rsedit-dit/events.out.tfevents.1777865962.ubuntu22.4001.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c82e91d9ce95ca392d916d197b88244b6cfbc7045990069b24d470b3a928dbd1
3
+ size 1483578
logs/rsedit-dit/events.out.tfevents.1777944234.ubuntu22.19227.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e41d6f8799d12c8abb581513a93313a20cb30ab4a923411445ac1fd44f1c9a07
3
+ size 88
model_index.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "RSEditModifiedDiTPipeline",
3
+ "_diffusers_version": "0.36.0",
4
+ "_name_or_path": "/data/projects/RSEdit/models/BiliSakura/RSEdit-DiT-Modified",
5
+ "scheduler": [
6
+ "diffusers",
7
+ "DPMSolverMultistepScheduler"
8
+ ],
9
+ "text_encoder": [
10
+ "transformers",
11
+ "T5EncoderModel"
12
+ ],
13
+ "tokenizer": [
14
+ "transformers",
15
+ "T5Tokenizer"
16
+ ],
17
+ "transformer": [
18
+ "diffusers",
19
+ "ConfiguredRSEditModifiedPixArtTransformer2DModel"
20
+ ],
21
+ "vae": [
22
+ "diffusers",
23
+ "AutoencoderKL"
24
+ ]
25
+ }
pipeline.py ADDED
@@ -0,0 +1,703 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+ # coding=utf-8
3
+
4
+ import os
5
+ from typing import Any, Callable, Dict, List, Optional, Tuple, Union
6
+
7
+ import PIL.Image
8
+ import numpy as np
9
+ import torch
10
+ import torch.nn as nn
11
+ import torch.nn.functional as F
12
+ from safetensors.torch import load_file as safetensors_load_file
13
+ from transformers import T5EncoderModel, T5Tokenizer
14
+
15
+ from diffusers import AutoencoderKL, PixArtAlphaPipeline
16
+ from diffusers.models.attention import BasicTransformerBlock
17
+ from diffusers.models.modeling_outputs import Transformer2DModelOutput
18
+ from diffusers.models.transformers.pixart_transformer_2d import PixArtTransformer2DModel
19
+ from diffusers.pipelines.pipeline_utils import ImagePipelineOutput
20
+ from diffusers.schedulers import KarrasDiffusionSchedulers
21
+
22
+
23
+ EXAMPLE_DOC_STRING = """
24
+ Examples:
25
+ ```py
26
+ >>> import torch
27
+ >>> from PIL import Image
28
+ >>> from diffusers import DiffusionPipeline
29
+
30
+ >>> pipe = DiffusionPipeline.from_pretrained(
31
+ ... "/data/projects/RSEdit/models/BiliSakura/RSEdit-DiT-Modified",
32
+ ... custom_pipeline="/data/projects/RSEdit/models/BiliSakura/RSEdit-DiT-Modified/pipeline.py",
33
+ ... trust_remote_code=True,
34
+ ... torch_dtype=torch.float16
35
+ ... ).to("cuda")
36
+
37
+ >>> source_image = Image.open("satellite_image.png").convert("RGB")
38
+ >>> image = pipe(
39
+ ... prompt="Flood the coastal area",
40
+ ... source_image=source_image,
41
+ ... num_inference_steps=50,
42
+ ... guidance_scale=4.5,
43
+ ... guidance_interval=(0.0, 1.0),
44
+ ... ).images[0]
45
+ >>> image.save("edited.png")
46
+ ```
47
+ """
48
+
49
+
50
+ def _window_partition(x: torch.Tensor, window_size: int) -> Tuple[torch.Tensor, Tuple[int, int]]:
51
+ b, h, w, c = x.shape
52
+ pad_h = (window_size - h % window_size) % window_size
53
+ pad_w = (window_size - w % window_size) % window_size
54
+ if pad_h > 0 or pad_w > 0:
55
+ x = F.pad(x, (0, 0, 0, pad_w, 0, pad_h))
56
+ hp, wp = h + pad_h, w + pad_w
57
+ x = x.view(b, hp // window_size, window_size, wp // window_size, window_size, c)
58
+ x = x.permute(0, 1, 3, 2, 4, 5).contiguous()
59
+ x = x.view(-1, window_size * window_size, c)
60
+ return x, (hp, wp)
61
+
62
+
63
+ def _window_unpartition(
64
+ windows: torch.Tensor,
65
+ window_size: int,
66
+ padded_hw: Tuple[int, int],
67
+ hw: Tuple[int, int],
68
+ ) -> torch.Tensor:
69
+ hp, wp = padded_hw
70
+ h, w = hw
71
+ num_windows_per_image = (hp // window_size) * (wp // window_size)
72
+ b = windows.shape[0] // num_windows_per_image
73
+ c = windows.shape[-1]
74
+ x = windows.view(b, hp // window_size, wp // window_size, window_size, window_size, c)
75
+ x = x.permute(0, 1, 3, 2, 4, 5).contiguous()
76
+ x = x.view(b, hp, wp, c)
77
+ if hp > h or wp > w:
78
+ x = x[:, :h, :w, :].contiguous()
79
+ return x
80
+
81
+
82
+ class DepthwiseConvFeedForward(nn.Module):
83
+ def __init__(self, original_ff: nn.Module):
84
+ super().__init__()
85
+ self.act = original_ff.net[0]
86
+ self.dropout = original_ff.net[1]
87
+ self.proj_out = original_ff.net[2]
88
+ self.final_dropout = original_ff.net[3] if len(original_ff.net) > 3 else None
89
+ inner_dim = self.proj_out.in_features
90
+ self.dwconv = nn.Conv2d(inner_dim, inner_dim, kernel_size=3, stride=1, padding=1, groups=inner_dim, bias=False)
91
+
92
+ def forward(self, hidden_states: torch.Tensor, height: Optional[int] = None, width: Optional[int] = None) -> torch.Tensor:
93
+ hidden_states = self.act(hidden_states)
94
+ if height is not None and width is not None and height * width == hidden_states.shape[1]:
95
+ bsz, _, channels = hidden_states.shape
96
+ hidden_states = hidden_states.transpose(1, 2).reshape(bsz, channels, height, width).contiguous()
97
+ hidden_states = self.dwconv(hidden_states)
98
+ hidden_states = hidden_states.reshape(bsz, channels, height * width).transpose(1, 2).contiguous()
99
+ hidden_states = self.dropout(hidden_states)
100
+ hidden_states = self.proj_out(hidden_states)
101
+ if self.final_dropout is not None:
102
+ hidden_states = self.final_dropout(hidden_states)
103
+ return hidden_states
104
+
105
+
106
+ class ModifiedPixArtTransformerBlock(nn.Module):
107
+ def __init__(self, block: BasicTransformerBlock, window_size: int = 8):
108
+ super().__init__()
109
+ self.norm_type = block.norm_type
110
+ self.only_cross_attention = block.only_cross_attention
111
+ self.use_ada_layer_norm_single = block.use_ada_layer_norm_single
112
+ self.norm1 = block.norm1
113
+ self.attn1 = block.attn1
114
+ self.attn2 = block.attn2
115
+ self.norm2 = block.norm2
116
+ self.norm3 = getattr(block, "norm3", None)
117
+ self.ff = DepthwiseConvFeedForward(block.ff)
118
+ self.fuser = getattr(block, "fuser", None)
119
+ self.scale_shift_table = getattr(block, "scale_shift_table", None)
120
+ self.pos_embed = block.pos_embed
121
+ self.window_size = int(window_size)
122
+ self._height = None
123
+ self._width = None
124
+
125
+ def set_spatial_shape(self, height: int, width: int):
126
+ self._height = int(height)
127
+ self._width = int(width)
128
+
129
+ def _apply_window_attention(
130
+ self,
131
+ norm_hidden_states: torch.Tensor,
132
+ attention_mask: Optional[torch.Tensor],
133
+ encoder_hidden_states: Optional[torch.Tensor],
134
+ cross_attention_kwargs: Dict[str, Any],
135
+ ) -> torch.Tensor:
136
+ if (
137
+ self.window_size <= 0
138
+ or self._height is None
139
+ or self._width is None
140
+ or attention_mask is not None
141
+ or self.only_cross_attention
142
+ ):
143
+ return self.attn1(
144
+ norm_hidden_states,
145
+ encoder_hidden_states=encoder_hidden_states if self.only_cross_attention else None,
146
+ attention_mask=attention_mask,
147
+ **cross_attention_kwargs,
148
+ )
149
+
150
+ bsz, num_tokens, channels = norm_hidden_states.shape
151
+ if self._height * self._width != num_tokens:
152
+ return self.attn1(
153
+ norm_hidden_states,
154
+ encoder_hidden_states=encoder_hidden_states if self.only_cross_attention else None,
155
+ attention_mask=attention_mask,
156
+ **cross_attention_kwargs,
157
+ )
158
+
159
+ window_input = norm_hidden_states.view(bsz, self._height, self._width, channels)
160
+ windows, padded_hw = _window_partition(window_input, self.window_size)
161
+ windows = self.attn1(windows, encoder_hidden_states=None, attention_mask=None, **cross_attention_kwargs)
162
+ windows = _window_unpartition(windows, self.window_size, padded_hw, (self._height, self._width))
163
+ return windows.view(bsz, num_tokens, channels)
164
+
165
+ def forward(
166
+ self,
167
+ hidden_states: torch.Tensor,
168
+ attention_mask: Optional[torch.Tensor] = None,
169
+ encoder_hidden_states: Optional[torch.Tensor] = None,
170
+ encoder_attention_mask: Optional[torch.Tensor] = None,
171
+ timestep: Optional[torch.LongTensor] = None,
172
+ cross_attention_kwargs: Dict[str, Any] = None,
173
+ class_labels: Optional[torch.LongTensor] = None,
174
+ added_cond_kwargs: Optional[Dict[str, torch.Tensor]] = None,
175
+ ) -> torch.Tensor:
176
+ batch_size = hidden_states.shape[0]
177
+
178
+ if self.norm_type == "ada_norm_single":
179
+ shift_msa, scale_msa, gate_msa, shift_mlp, scale_mlp, gate_mlp = (
180
+ self.scale_shift_table[None] + timestep.reshape(batch_size, 6, -1)
181
+ ).chunk(6, dim=1)
182
+ norm_hidden_states = self.norm1(hidden_states)
183
+ norm_hidden_states = norm_hidden_states * (1 + scale_msa) + shift_msa
184
+ else:
185
+ norm_hidden_states = self.norm1(hidden_states)
186
+
187
+ if self.pos_embed is not None:
188
+ norm_hidden_states = self.pos_embed(norm_hidden_states)
189
+
190
+ cross_attention_kwargs = cross_attention_kwargs.copy() if cross_attention_kwargs is not None else {}
191
+ gligen_kwargs = cross_attention_kwargs.pop("gligen", None)
192
+
193
+ attn_output = self._apply_window_attention(
194
+ norm_hidden_states=norm_hidden_states,
195
+ attention_mask=attention_mask,
196
+ encoder_hidden_states=encoder_hidden_states,
197
+ cross_attention_kwargs=cross_attention_kwargs,
198
+ )
199
+
200
+ if self.norm_type == "ada_norm_single":
201
+ attn_output = gate_msa * attn_output
202
+
203
+ hidden_states = attn_output + hidden_states
204
+ if hidden_states.ndim == 4:
205
+ hidden_states = hidden_states.squeeze(1)
206
+
207
+ if gligen_kwargs is not None and self.fuser is not None:
208
+ hidden_states = self.fuser(hidden_states, gligen_kwargs["objs"])
209
+
210
+ if self.attn2 is not None:
211
+ norm_hidden_states = hidden_states if self.norm_type == "ada_norm_single" else self.norm2(hidden_states)
212
+ if self.pos_embed is not None and self.norm_type != "ada_norm_single":
213
+ norm_hidden_states = self.pos_embed(norm_hidden_states)
214
+ attn_output = self.attn2(
215
+ norm_hidden_states,
216
+ encoder_hidden_states=encoder_hidden_states,
217
+ attention_mask=encoder_attention_mask,
218
+ **cross_attention_kwargs,
219
+ )
220
+ hidden_states = attn_output + hidden_states
221
+
222
+ if self.norm_type == "ada_norm_single":
223
+ norm_hidden_states = self.norm2(hidden_states)
224
+ norm_hidden_states = norm_hidden_states * (1 + scale_mlp) + shift_mlp
225
+ else:
226
+ norm_hidden_states = self.norm3(hidden_states)
227
+
228
+ ff_output = self.ff(norm_hidden_states, height=self._height, width=self._width)
229
+ if self.norm_type == "ada_norm_single":
230
+ ff_output = gate_mlp * ff_output
231
+
232
+ hidden_states = ff_output + hidden_states
233
+ if hidden_states.ndim == 4:
234
+ hidden_states = hidden_states.squeeze(1)
235
+ return hidden_states
236
+
237
+
238
+ class RSEditModifiedPixArtTransformer2DModel(PixArtTransformer2DModel):
239
+ def __init__(
240
+ self,
241
+ num_attention_heads: int = 16,
242
+ attention_head_dim: int = 72,
243
+ in_channels: int = 4,
244
+ out_channels: Optional[int] = 8,
245
+ num_layers: int = 28,
246
+ dropout: float = 0.0,
247
+ norm_num_groups: int = 32,
248
+ cross_attention_dim: Optional[int] = 1152,
249
+ attention_bias: bool = True,
250
+ sample_size: int = 128,
251
+ patch_size: int = 2,
252
+ activation_fn: str = "gelu-approximate",
253
+ num_embeds_ada_norm: Optional[int] = 1000,
254
+ upcast_attention: bool = False,
255
+ norm_type: str = "ada_norm_single",
256
+ norm_elementwise_affine: bool = False,
257
+ norm_eps: float = 1e-6,
258
+ interpolation_scale: Optional[int] = None,
259
+ use_additional_conditions: Optional[bool] = None,
260
+ caption_channels: Optional[int] = None,
261
+ attention_type: Optional[str] = "default",
262
+ rsedit_modified_dit: bool = True,
263
+ rsedit_window_size: int = 8,
264
+ rsedit_window_skip_every: int = 4,
265
+ double_self_attention: bool = False,
266
+ num_vector_embeds: Optional[int] = None,
267
+ only_cross_attention: bool = False,
268
+ use_linear_projection: bool = False,
269
+ **kwargs,
270
+ ):
271
+ super().__init__(
272
+ num_attention_heads=num_attention_heads,
273
+ attention_head_dim=attention_head_dim,
274
+ in_channels=in_channels,
275
+ out_channels=out_channels,
276
+ num_layers=num_layers,
277
+ dropout=dropout,
278
+ norm_num_groups=norm_num_groups,
279
+ cross_attention_dim=cross_attention_dim,
280
+ attention_bias=attention_bias,
281
+ sample_size=sample_size,
282
+ patch_size=patch_size,
283
+ activation_fn=activation_fn,
284
+ num_embeds_ada_norm=num_embeds_ada_norm,
285
+ upcast_attention=upcast_attention,
286
+ norm_type=norm_type,
287
+ norm_elementwise_affine=norm_elementwise_affine,
288
+ norm_eps=norm_eps,
289
+ interpolation_scale=interpolation_scale,
290
+ use_additional_conditions=use_additional_conditions,
291
+ caption_channels=caption_channels,
292
+ attention_type=attention_type,
293
+ **kwargs,
294
+ )
295
+ self.register_to_config(
296
+ rsedit_modified_dit=bool(rsedit_modified_dit),
297
+ rsedit_window_size=int(rsedit_window_size),
298
+ rsedit_window_skip_every=int(rsedit_window_skip_every),
299
+ double_self_attention=bool(double_self_attention),
300
+ num_vector_embeds=num_vector_embeds,
301
+ only_cross_attention=bool(only_cross_attention),
302
+ use_linear_projection=bool(use_linear_projection),
303
+ )
304
+
305
+ @classmethod
306
+ def from_pretrained(cls, pretrained_model_name_or_path: str, *model_args, **kwargs):
307
+ window_size = kwargs.pop("window_size", None)
308
+ window_skip_every = kwargs.pop("window_skip_every", None)
309
+ subfolder = kwargs.get("subfolder")
310
+ weights_dir = pretrained_model_name_or_path
311
+ if subfolder:
312
+ weights_dir = os.path.join(weights_dir, subfolder)
313
+ safetensors_path = os.path.join(weights_dir, "diffusion_pytorch_model.safetensors")
314
+
315
+ # Prefer a direct load path for checkpoints saved from the modified
316
+ # architecture (keys include ff.act/proj_out/dwconv).
317
+ if os.path.isfile(safetensors_path):
318
+ state_dict = safetensors_load_file(safetensors_path)
319
+ if any(".ff.act." in k or ".ff.dwconv." in k for k in state_dict.keys()):
320
+ config = cls.load_config(pretrained_model_name_or_path, subfolder=subfolder)
321
+ model = cls.from_config(config)
322
+ if window_size is None:
323
+ window_size = int(getattr(model.config, "rsedit_window_size", 8))
324
+ if window_skip_every is None:
325
+ window_skip_every = int(getattr(model.config, "rsedit_window_skip_every", 4))
326
+ model._apply_rsedit_block_modifications(window_size=window_size, window_skip_every=window_skip_every)
327
+ model.load_state_dict(state_dict, strict=False)
328
+ torch_dtype = kwargs.get("torch_dtype", None)
329
+ if torch_dtype is not None:
330
+ model = model.to(dtype=torch_dtype)
331
+ return model
332
+
333
+ kwargs.setdefault("low_cpu_mem_usage", False)
334
+ model = super().from_pretrained(pretrained_model_name_or_path, *model_args, **kwargs)
335
+ if window_size is None:
336
+ window_size = int(getattr(model.config, "rsedit_window_size", 8))
337
+ if window_skip_every is None:
338
+ window_skip_every = int(getattr(model.config, "rsedit_window_skip_every", 4))
339
+ model._apply_rsedit_block_modifications(window_size=window_size, window_skip_every=window_skip_every)
340
+ return model
341
+
342
+ def save_pretrained(self, save_directory: Union[str, os.PathLike], *args, **kwargs):
343
+ return super().save_pretrained(save_directory, *args, **kwargs)
344
+
345
+ def _apply_rsedit_block_modifications(self, window_size: int = 8, window_skip_every: int = 4):
346
+ if getattr(self, "_rsedit_modified", False):
347
+ return
348
+ converted_blocks = []
349
+ for idx, block in enumerate(self.transformer_blocks):
350
+ block_window_size = window_size
351
+ if window_skip_every > 0 and (idx + 1) % window_skip_every == 0:
352
+ block_window_size = 0
353
+ converted_blocks.append(ModifiedPixArtTransformerBlock(block, window_size=block_window_size))
354
+ self.transformer_blocks = nn.ModuleList(converted_blocks)
355
+ self._rsedit_modified = True
356
+ self.register_to_config(
357
+ rsedit_modified_dit=True,
358
+ rsedit_window_size=int(window_size),
359
+ rsedit_window_skip_every=int(window_skip_every),
360
+ )
361
+
362
+ def forward(
363
+ self,
364
+ hidden_states: torch.Tensor,
365
+ encoder_hidden_states: Optional[torch.Tensor] = None,
366
+ timestep: Optional[torch.LongTensor] = None,
367
+ added_cond_kwargs: Dict[str, torch.Tensor] = None,
368
+ cross_attention_kwargs: Dict[str, Any] = None,
369
+ attention_mask: Optional[torch.Tensor] = None,
370
+ encoder_attention_mask: Optional[torch.Tensor] = None,
371
+ return_dict: bool = True,
372
+ ):
373
+ if self.use_additional_conditions and added_cond_kwargs is None:
374
+ raise ValueError("`added_cond_kwargs` cannot be None when using additional conditions for `adaln_single`.")
375
+ if attention_mask is not None and attention_mask.ndim == 2:
376
+ attention_mask = (1 - attention_mask.to(hidden_states.dtype)) * -10000.0
377
+ attention_mask = attention_mask.unsqueeze(1)
378
+ if encoder_attention_mask is not None and encoder_attention_mask.ndim == 2:
379
+ encoder_attention_mask = (1 - encoder_attention_mask.to(hidden_states.dtype)) * -10000.0
380
+ encoder_attention_mask = encoder_attention_mask.unsqueeze(1)
381
+
382
+ batch_size = hidden_states.shape[0]
383
+ height = hidden_states.shape[-2] // self.config.patch_size
384
+ width = hidden_states.shape[-1] // self.config.patch_size
385
+ hidden_states = self.pos_embed(hidden_states)
386
+ timestep, embedded_timestep = self.adaln_single(
387
+ timestep, added_cond_kwargs, batch_size=batch_size, hidden_dtype=hidden_states.dtype
388
+ )
389
+
390
+ if self.caption_projection is not None:
391
+ encoder_hidden_states = self.caption_projection(encoder_hidden_states)
392
+ encoder_hidden_states = encoder_hidden_states.view(batch_size, -1, hidden_states.shape[-1])
393
+
394
+ for block in self.transformer_blocks:
395
+ if hasattr(block, "set_spatial_shape"):
396
+ block.set_spatial_shape(height, width)
397
+ if torch.is_grad_enabled() and self.gradient_checkpointing:
398
+ hidden_states = self._gradient_checkpointing_func(
399
+ block,
400
+ hidden_states,
401
+ attention_mask,
402
+ encoder_hidden_states,
403
+ encoder_attention_mask,
404
+ timestep,
405
+ cross_attention_kwargs,
406
+ None,
407
+ )
408
+ else:
409
+ hidden_states = block(
410
+ hidden_states,
411
+ attention_mask=attention_mask,
412
+ encoder_hidden_states=encoder_hidden_states,
413
+ encoder_attention_mask=encoder_attention_mask,
414
+ timestep=timestep,
415
+ cross_attention_kwargs=cross_attention_kwargs,
416
+ class_labels=None,
417
+ )
418
+
419
+ shift, scale = (self.scale_shift_table[None] + embedded_timestep[:, None].to(self.scale_shift_table.device)).chunk(2, dim=1)
420
+ hidden_states = self.norm_out(hidden_states)
421
+ hidden_states = hidden_states * (1 + scale.to(hidden_states.device)) + shift.to(hidden_states.device)
422
+ hidden_states = self.proj_out(hidden_states)
423
+ hidden_states = hidden_states.squeeze(1)
424
+
425
+ hidden_states = hidden_states.reshape((-1, height, width, self.config.patch_size, self.config.patch_size, self.out_channels))
426
+ hidden_states = torch.einsum("nhwpqc->nchpwq", hidden_states)
427
+ output = hidden_states.reshape((-1, self.out_channels, height * self.config.patch_size, width * self.config.patch_size))
428
+ if not return_dict:
429
+ return (output,)
430
+ return Transformer2DModelOutput(sample=output)
431
+
432
+
433
+ # Keep class name compatible with existing transformer/config.json
434
+ ConfiguredRSEditModifiedPixArtTransformer2DModel = RSEditModifiedPixArtTransformer2DModel
435
+ import diffusers as _diffusers
436
+ setattr(_diffusers, "ConfiguredRSEditModifiedPixArtTransformer2DModel", ConfiguredRSEditModifiedPixArtTransformer2DModel)
437
+
438
+
439
+ class RSEditModifiedDiTPipeline(PixArtAlphaPipeline):
440
+ def __init__(
441
+ self,
442
+ vae: AutoencoderKL,
443
+ text_encoder: T5EncoderModel,
444
+ tokenizer: T5Tokenizer,
445
+ transformer: PixArtTransformer2DModel,
446
+ scheduler: KarrasDiffusionSchedulers,
447
+ ):
448
+ super().__init__(
449
+ vae=vae,
450
+ text_encoder=text_encoder,
451
+ tokenizer=tokenizer,
452
+ transformer=transformer,
453
+ scheduler=scheduler,
454
+ )
455
+
456
+ def _encode_source_image(
457
+ self,
458
+ source_image: PIL.Image.Image,
459
+ device: torch.device,
460
+ dtype: torch.dtype,
461
+ num_images_per_prompt: int = 1,
462
+ ) -> torch.Tensor:
463
+ image_np = np.array(source_image.convert("RGB")).astype(np.float32) / 127.5 - 1.0
464
+ image_tensor = torch.from_numpy(image_np).permute(2, 0, 1).unsqueeze(0)
465
+ image_tensor = image_tensor.to(device=device, dtype=self.vae.dtype)
466
+ latents = self.vae.encode(image_tensor).latent_dist.mode()
467
+ latents = latents * self.vae.config.scaling_factor
468
+ latents = latents.to(device=device, dtype=dtype)
469
+ if num_images_per_prompt > 1:
470
+ latents = latents.repeat(num_images_per_prompt, 1, 1, 1)
471
+ return latents
472
+
473
+ @torch.no_grad()
474
+ def __call__(
475
+ self,
476
+ prompt: Union[str, List[str]] = None,
477
+ source_image: Union[PIL.Image.Image, List[PIL.Image.Image]] = None,
478
+ negative_prompt: str = "",
479
+ num_inference_steps: int = 50,
480
+ timesteps: List[int] = None,
481
+ guidance_scale: float = 4.5,
482
+ guidance_interval: Tuple[float, float] = (0.0, 1.0),
483
+ image_guidance_scale: Optional[float] = 1.5,
484
+ num_images_per_prompt: Optional[int] = 1,
485
+ height: Optional[int] = None,
486
+ width: Optional[int] = None,
487
+ eta: float = 0.0,
488
+ generator: Optional[Union[torch.Generator, List[torch.Generator]]] = None,
489
+ latents: Optional[torch.FloatTensor] = None,
490
+ prompt_embeds: Optional[torch.FloatTensor] = None,
491
+ prompt_attention_mask: Optional[torch.FloatTensor] = None,
492
+ negative_prompt_embeds: Optional[torch.FloatTensor] = None,
493
+ negative_prompt_attention_mask: Optional[torch.FloatTensor] = None,
494
+ output_type: Optional[str] = "pil",
495
+ return_dict: bool = True,
496
+ callback: Optional[Callable[[int, int, torch.FloatTensor], None]] = None,
497
+ callback_steps: int = 1,
498
+ clean_caption: bool = True,
499
+ use_resolution_binning: bool = True,
500
+ max_sequence_length: int = 120,
501
+ **kwargs,
502
+ ) -> Union[ImagePipelineOutput, tuple]:
503
+ """
504
+ Run instruction-guided image editing with RSEdit DiT.
505
+
506
+ `guidance_interval` controls when classifier-free guidance is active across denoising
507
+ timesteps. The default `(0.0, 1.0)` enables guidance for the full schedule to match
508
+ prior behavior.
509
+ """
510
+ if source_image is None:
511
+ raise ValueError("`source_image` must be provided for RSEdit image editing.")
512
+ if prompt is None and prompt_embeds is None:
513
+ raise ValueError("Either `prompt` or `prompt_embeds` must be provided.")
514
+ if len(guidance_interval) != 2 or guidance_interval[0] > guidance_interval[1]:
515
+ raise ValueError(
516
+ "`guidance_interval` must be a tuple of two values in ascending order, e.g. (0.0, 1.0)."
517
+ )
518
+
519
+ if height is None:
520
+ height = self.transformer.config.sample_size * self.vae_scale_factor
521
+ if width is None:
522
+ width = self.transformer.config.sample_size * self.vae_scale_factor
523
+
524
+ if prompt is not None and isinstance(prompt, str):
525
+ batch_size = 1
526
+ elif prompt is not None and isinstance(prompt, list):
527
+ batch_size = len(prompt)
528
+ else:
529
+ batch_size = prompt_embeds.shape[0]
530
+
531
+ device = self._execution_device
532
+
533
+ if isinstance(source_image, PIL.Image.Image):
534
+ source_image = source_image.resize((width, height), PIL.Image.LANCZOS)
535
+ elif isinstance(source_image, list):
536
+ source_image = [img.resize((width, height), PIL.Image.LANCZOS) for img in source_image]
537
+ if len(source_image) != batch_size:
538
+ raise ValueError(f"Number of source images ({len(source_image)}) must match batch size ({batch_size})")
539
+
540
+ if isinstance(source_image, list):
541
+ source_latents_list = []
542
+ for img in source_image:
543
+ source_latents_list.append(self._encode_source_image(img, device, self.vae.dtype, num_images_per_prompt).to(device=device))
544
+ source_latents = torch.cat(source_latents_list, dim=0)
545
+ else:
546
+ source_latents = self._encode_source_image(source_image, device, self.vae.dtype, num_images_per_prompt)
547
+
548
+ if batch_size > 1 and source_latents.shape[0] == 1:
549
+ source_latents = source_latents.repeat(batch_size * num_images_per_prompt, 1, 1, 1)
550
+
551
+ # Default image_guidance_scale to 1.5 when explicitly unset.
552
+ if image_guidance_scale is None:
553
+ image_guidance_scale = 1.5
554
+ do_classifier_free_guidance = guidance_scale > 1.0 and image_guidance_scale >= 1.0
555
+
556
+ (
557
+ prompt_embeds,
558
+ prompt_attention_mask,
559
+ negative_prompt_embeds,
560
+ negative_prompt_attention_mask,
561
+ ) = self.encode_prompt(
562
+ prompt,
563
+ do_classifier_free_guidance,
564
+ negative_prompt=negative_prompt,
565
+ num_images_per_prompt=num_images_per_prompt,
566
+ device=device,
567
+ prompt_embeds=prompt_embeds,
568
+ negative_prompt_embeds=negative_prompt_embeds,
569
+ prompt_attention_mask=prompt_attention_mask,
570
+ negative_prompt_attention_mask=negative_prompt_attention_mask,
571
+ clean_caption=clean_caption,
572
+ max_sequence_length=max_sequence_length,
573
+ )
574
+
575
+ base_prompt_embeds = prompt_embeds
576
+ base_prompt_attention_mask = prompt_attention_mask
577
+ cfg_prompt_embeds = None
578
+ cfg_prompt_attention_mask = None
579
+
580
+ if do_classifier_free_guidance:
581
+ cfg_prompt_embeds = torch.cat([prompt_embeds, negative_prompt_embeds, negative_prompt_embeds], dim=0)
582
+ cfg_prompt_attention_mask = torch.cat(
583
+ [prompt_attention_mask, negative_prompt_attention_mask, negative_prompt_attention_mask], dim=0
584
+ )
585
+
586
+ self.scheduler.set_timesteps(num_inference_steps, device=device)
587
+ timesteps = self.scheduler.timesteps
588
+
589
+ num_channels_latents = self.transformer.config.in_channels
590
+ latents = self.prepare_latents(
591
+ batch_size * num_images_per_prompt,
592
+ num_channels_latents,
593
+ height,
594
+ width,
595
+ prompt_embeds.dtype,
596
+ device,
597
+ generator,
598
+ latents,
599
+ )
600
+
601
+ source_latents = source_latents.to(device=latents.device)
602
+ extra_step_kwargs = self.prepare_extra_step_kwargs(generator, eta)
603
+
604
+ base_added_cond_kwargs = {"resolution": None, "aspect_ratio": None}
605
+ cfg_added_cond_kwargs = base_added_cond_kwargs
606
+ use_additional_conditions = bool(
607
+ getattr(getattr(self.transformer, "adaln_single", None), "emb", None) is not None
608
+ and getattr(self.transformer.adaln_single.emb, "use_additional_conditions", False)
609
+ )
610
+ if use_additional_conditions:
611
+ resolution = torch.tensor([height, width]).repeat(batch_size * num_images_per_prompt, 1)
612
+ aspect_ratio = torch.tensor([float(height / width)]).repeat(batch_size * num_images_per_prompt, 1)
613
+ resolution = resolution.to(dtype=prompt_embeds.dtype, device=device)
614
+ aspect_ratio = aspect_ratio.to(dtype=prompt_embeds.dtype, device=device)
615
+ if do_classifier_free_guidance:
616
+ cfg_added_cond_kwargs = {
617
+ "resolution": torch.cat([resolution, resolution, resolution], dim=0),
618
+ "aspect_ratio": torch.cat([aspect_ratio, aspect_ratio, aspect_ratio], dim=0),
619
+ }
620
+ base_added_cond_kwargs = {"resolution": resolution, "aspect_ratio": aspect_ratio}
621
+
622
+ num_warmup_steps = max(len(timesteps) - num_inference_steps * self.scheduler.order, 0)
623
+ with self.progress_bar(total=num_inference_steps) as progress_bar:
624
+ for i, t in enumerate(timesteps):
625
+ guidance_active = do_classifier_free_guidance and guidance_interval[0] <= float(t) <= guidance_interval[1]
626
+
627
+ latent_model_input = torch.cat([latents] * 3) if guidance_active else latents
628
+ latent_model_input = self.scheduler.scale_model_input(latent_model_input, t)
629
+ if guidance_active:
630
+ source_latents_input = torch.cat([source_latents, source_latents, torch.zeros_like(source_latents)], dim=0)
631
+ prompt_embeds_input = cfg_prompt_embeds
632
+ prompt_attention_mask_input = cfg_prompt_attention_mask
633
+ added_cond_kwargs_input = cfg_added_cond_kwargs
634
+ else:
635
+ source_latents_input = source_latents
636
+ prompt_embeds_input = base_prompt_embeds
637
+ prompt_attention_mask_input = base_prompt_attention_mask
638
+ added_cond_kwargs_input = base_added_cond_kwargs
639
+
640
+ source_latents_input = source_latents_input.to(device=latent_model_input.device)
641
+ concatenated_latents = torch.cat([source_latents_input, latent_model_input], dim=3)
642
+
643
+ current_timestep = t
644
+ if not torch.is_tensor(current_timestep):
645
+ is_mps = concatenated_latents.device.type == "mps"
646
+ is_npu = concatenated_latents.device.type == "npu"
647
+ if isinstance(current_timestep, float):
648
+ dtype = torch.float32 if (is_mps or is_npu) else torch.float64
649
+ else:
650
+ dtype = torch.int32 if (is_mps or is_npu) else torch.int64
651
+ current_timestep = torch.tensor([current_timestep], dtype=dtype, device=concatenated_latents.device)
652
+ elif len(current_timestep.shape) == 0:
653
+ current_timestep = current_timestep[None].to(concatenated_latents.device)
654
+ current_timestep = current_timestep.expand(concatenated_latents.shape[0])
655
+
656
+ noise_pred = self.transformer(
657
+ concatenated_latents,
658
+ encoder_hidden_states=prompt_embeds_input,
659
+ encoder_attention_mask=prompt_attention_mask_input,
660
+ timestep=current_timestep,
661
+ added_cond_kwargs=added_cond_kwargs_input,
662
+ return_dict=False,
663
+ )[0]
664
+
665
+ target_width = latents.shape[3]
666
+ noise_pred = noise_pred[:, :, :, target_width:]
667
+ if noise_pred.shape[1] == 2 * num_channels_latents:
668
+ noise_pred, _ = noise_pred.chunk(2, dim=1)
669
+
670
+ if guidance_active:
671
+ # noise_pred batch: [Text+Image, Image, None]
672
+ noise_pred_text, noise_pred_image, noise_pred_uncond = noise_pred.chunk(3)
673
+
674
+ # IP2P CFG Formula:
675
+ # pred = uncond + s_text * (text - image) + s_image * (image - uncond)
676
+ # Mapping:
677
+ # e(c_I, c_T) -> noise_pred_text (Full)
678
+ # e(c_I, phi) -> noise_pred_image (Image only, Null Text)
679
+ # e(phi, phi) -> noise_pred_uncond (Unconditional)
680
+ noise_pred = (
681
+ noise_pred_uncond
682
+ + guidance_scale * (noise_pred_text - noise_pred_image)
683
+ + image_guidance_scale * (noise_pred_image - noise_pred_uncond)
684
+ )
685
+
686
+ latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs, return_dict=False)[0]
687
+
688
+ if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):
689
+ progress_bar.update()
690
+ if callback is not None and i % callback_steps == 0:
691
+ step_idx = i // getattr(self.scheduler, "order", 1)
692
+ callback(step_idx, t, latents)
693
+
694
+ if output_type != "latent":
695
+ image = self.vae.decode(latents.to(self.vae.dtype) / self.vae.config.scaling_factor, return_dict=False)[0]
696
+ image = self.image_processor.postprocess(image, output_type=output_type)
697
+ else:
698
+ image = latents
699
+
700
+ self.maybe_free_model_hooks()
701
+ if not return_dict:
702
+ return (image,)
703
+ return ImagePipelineOutput(images=image)
scheduler/scheduler_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "DPMSolverMultistepScheduler",
3
+ "_diffusers_version": "0.36.0.dev0",
4
+ "algorithm_type": "dpmsolver++",
5
+ "beta_end": 0.02,
6
+ "beta_schedule": "linear",
7
+ "beta_start": 0.0001,
8
+ "dynamic_thresholding_ratio": 0.995,
9
+ "euler_at_final": false,
10
+ "final_sigmas_type": "zero",
11
+ "flow_shift": 1.0,
12
+ "lambda_min_clipped": -Infinity,
13
+ "lower_order_final": true,
14
+ "num_train_timesteps": 1000,
15
+ "prediction_type": "epsilon",
16
+ "rescale_betas_zero_snr": false,
17
+ "sample_max_value": 1.0,
18
+ "solver_order": 2,
19
+ "solver_type": "midpoint",
20
+ "steps_offset": 0,
21
+ "thresholding": false,
22
+ "time_shift_type": "exponential",
23
+ "timestep_spacing": "linspace",
24
+ "trained_betas": null,
25
+ "use_beta_sigmas": false,
26
+ "use_dynamic_shifting": false,
27
+ "use_exponential_sigmas": false,
28
+ "use_flow_sigmas": false,
29
+ "use_karras_sigmas": false,
30
+ "use_lu_lambdas": false,
31
+ "variance_type": null
32
+ }
text_encoder/config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "T5EncoderModel"
4
+ ],
5
+ "classifier_dropout": 0.0,
6
+ "d_ff": 10240,
7
+ "d_kv": 64,
8
+ "d_model": 4096,
9
+ "decoder_start_token_id": 0,
10
+ "dense_act_fn": "gelu_new",
11
+ "dropout_rate": 0.1,
12
+ "dtype": "bfloat16",
13
+ "eos_token_id": 1,
14
+ "feed_forward_proj": "gated-gelu",
15
+ "initializer_factor": 1.0,
16
+ "is_encoder_decoder": false,
17
+ "is_gated_act": true,
18
+ "layer_norm_epsilon": 1e-06,
19
+ "model_type": "t5",
20
+ "num_decoder_layers": 24,
21
+ "num_heads": 64,
22
+ "num_layers": 24,
23
+ "output_past": true,
24
+ "pad_token_id": 0,
25
+ "relative_attention_max_distance": 128,
26
+ "relative_attention_num_buckets": 32,
27
+ "tie_encoder_decoder": true,
28
+ "tie_word_embeddings": false,
29
+ "transformers_version": "5.0.0.dev0",
30
+ "use_cache": false,
31
+ "vocab_size": 32128
32
+ }
text_encoder/model-00001-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec87bffd1923e8b2774a6d240c922a41f6143081d52cf83b8fe39e9d838c893e
3
+ size 4994582224
text_encoder/model-00002-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5640855b301fcdbceddfa90ae8066cd9414aff020552a201a255ecf2059da00
3
+ size 4530066360
text_encoder/model.safetensors.index.json ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_parameters": 4762310656,
4
+ "total_size": 9524621312
5
+ },
6
+ "weight_map": {
7
+ "encoder.block.0.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
8
+ "encoder.block.0.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
9
+ "encoder.block.0.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
10
+ "encoder.block.0.layer.0.SelfAttention.relative_attention_bias.weight": "model-00001-of-00002.safetensors",
11
+ "encoder.block.0.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
12
+ "encoder.block.0.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
13
+ "encoder.block.0.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
14
+ "encoder.block.0.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
15
+ "encoder.block.0.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
16
+ "encoder.block.0.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
17
+ "encoder.block.1.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
18
+ "encoder.block.1.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
19
+ "encoder.block.1.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
20
+ "encoder.block.1.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
21
+ "encoder.block.1.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
22
+ "encoder.block.1.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
23
+ "encoder.block.1.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
24
+ "encoder.block.1.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
25
+ "encoder.block.1.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
26
+ "encoder.block.10.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
27
+ "encoder.block.10.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
28
+ "encoder.block.10.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
29
+ "encoder.block.10.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
30
+ "encoder.block.10.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
31
+ "encoder.block.10.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
32
+ "encoder.block.10.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
33
+ "encoder.block.10.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
34
+ "encoder.block.10.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
35
+ "encoder.block.11.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
36
+ "encoder.block.11.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
37
+ "encoder.block.11.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
38
+ "encoder.block.11.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
39
+ "encoder.block.11.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
40
+ "encoder.block.11.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
41
+ "encoder.block.11.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
42
+ "encoder.block.11.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
43
+ "encoder.block.11.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
44
+ "encoder.block.12.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
45
+ "encoder.block.12.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
46
+ "encoder.block.12.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
47
+ "encoder.block.12.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
48
+ "encoder.block.12.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
49
+ "encoder.block.12.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
50
+ "encoder.block.12.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
51
+ "encoder.block.12.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
52
+ "encoder.block.12.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
53
+ "encoder.block.13.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
54
+ "encoder.block.13.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
55
+ "encoder.block.13.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
56
+ "encoder.block.13.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
57
+ "encoder.block.13.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
58
+ "encoder.block.13.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
59
+ "encoder.block.13.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
60
+ "encoder.block.13.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
61
+ "encoder.block.13.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
62
+ "encoder.block.14.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
63
+ "encoder.block.14.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
64
+ "encoder.block.14.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
65
+ "encoder.block.14.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
66
+ "encoder.block.14.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
67
+ "encoder.block.14.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
68
+ "encoder.block.14.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
69
+ "encoder.block.14.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
70
+ "encoder.block.14.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
71
+ "encoder.block.15.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
72
+ "encoder.block.15.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
73
+ "encoder.block.15.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
74
+ "encoder.block.15.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
75
+ "encoder.block.15.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
76
+ "encoder.block.15.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
77
+ "encoder.block.15.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
78
+ "encoder.block.15.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
79
+ "encoder.block.15.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
80
+ "encoder.block.16.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
81
+ "encoder.block.16.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
82
+ "encoder.block.16.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
83
+ "encoder.block.16.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
84
+ "encoder.block.16.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
85
+ "encoder.block.16.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
86
+ "encoder.block.16.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
87
+ "encoder.block.16.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
88
+ "encoder.block.16.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
89
+ "encoder.block.17.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
90
+ "encoder.block.17.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
91
+ "encoder.block.17.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
92
+ "encoder.block.17.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
93
+ "encoder.block.17.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
94
+ "encoder.block.17.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
95
+ "encoder.block.17.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
96
+ "encoder.block.17.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
97
+ "encoder.block.17.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
98
+ "encoder.block.18.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
99
+ "encoder.block.18.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
100
+ "encoder.block.18.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
101
+ "encoder.block.18.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
102
+ "encoder.block.18.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
103
+ "encoder.block.18.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
104
+ "encoder.block.18.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
105
+ "encoder.block.18.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
106
+ "encoder.block.18.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
107
+ "encoder.block.19.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
108
+ "encoder.block.19.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
109
+ "encoder.block.19.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
110
+ "encoder.block.19.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
111
+ "encoder.block.19.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
112
+ "encoder.block.19.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
113
+ "encoder.block.19.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
114
+ "encoder.block.19.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
115
+ "encoder.block.19.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
116
+ "encoder.block.2.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
117
+ "encoder.block.2.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
118
+ "encoder.block.2.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
119
+ "encoder.block.2.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
120
+ "encoder.block.2.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
121
+ "encoder.block.2.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
122
+ "encoder.block.2.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
123
+ "encoder.block.2.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
124
+ "encoder.block.2.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
125
+ "encoder.block.20.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
126
+ "encoder.block.20.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
127
+ "encoder.block.20.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
128
+ "encoder.block.20.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
129
+ "encoder.block.20.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
130
+ "encoder.block.20.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
131
+ "encoder.block.20.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
132
+ "encoder.block.20.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
133
+ "encoder.block.20.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
134
+ "encoder.block.21.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
135
+ "encoder.block.21.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
136
+ "encoder.block.21.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
137
+ "encoder.block.21.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
138
+ "encoder.block.21.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
139
+ "encoder.block.21.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
140
+ "encoder.block.21.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
141
+ "encoder.block.21.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
142
+ "encoder.block.21.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
143
+ "encoder.block.22.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
144
+ "encoder.block.22.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
145
+ "encoder.block.22.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
146
+ "encoder.block.22.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
147
+ "encoder.block.22.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
148
+ "encoder.block.22.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
149
+ "encoder.block.22.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
150
+ "encoder.block.22.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
151
+ "encoder.block.22.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
152
+ "encoder.block.23.layer.0.SelfAttention.k.weight": "model-00002-of-00002.safetensors",
153
+ "encoder.block.23.layer.0.SelfAttention.o.weight": "model-00002-of-00002.safetensors",
154
+ "encoder.block.23.layer.0.SelfAttention.q.weight": "model-00002-of-00002.safetensors",
155
+ "encoder.block.23.layer.0.SelfAttention.v.weight": "model-00002-of-00002.safetensors",
156
+ "encoder.block.23.layer.0.layer_norm.weight": "model-00002-of-00002.safetensors",
157
+ "encoder.block.23.layer.1.DenseReluDense.wi_0.weight": "model-00002-of-00002.safetensors",
158
+ "encoder.block.23.layer.1.DenseReluDense.wi_1.weight": "model-00002-of-00002.safetensors",
159
+ "encoder.block.23.layer.1.DenseReluDense.wo.weight": "model-00002-of-00002.safetensors",
160
+ "encoder.block.23.layer.1.layer_norm.weight": "model-00002-of-00002.safetensors",
161
+ "encoder.block.3.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
162
+ "encoder.block.3.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
163
+ "encoder.block.3.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
164
+ "encoder.block.3.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
165
+ "encoder.block.3.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
166
+ "encoder.block.3.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
167
+ "encoder.block.3.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
168
+ "encoder.block.3.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
169
+ "encoder.block.3.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
170
+ "encoder.block.4.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
171
+ "encoder.block.4.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
172
+ "encoder.block.4.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
173
+ "encoder.block.4.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
174
+ "encoder.block.4.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
175
+ "encoder.block.4.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
176
+ "encoder.block.4.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
177
+ "encoder.block.4.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
178
+ "encoder.block.4.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
179
+ "encoder.block.5.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
180
+ "encoder.block.5.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
181
+ "encoder.block.5.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
182
+ "encoder.block.5.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
183
+ "encoder.block.5.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
184
+ "encoder.block.5.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
185
+ "encoder.block.5.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
186
+ "encoder.block.5.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
187
+ "encoder.block.5.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
188
+ "encoder.block.6.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
189
+ "encoder.block.6.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
190
+ "encoder.block.6.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
191
+ "encoder.block.6.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
192
+ "encoder.block.6.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
193
+ "encoder.block.6.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
194
+ "encoder.block.6.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
195
+ "encoder.block.6.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
196
+ "encoder.block.6.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
197
+ "encoder.block.7.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
198
+ "encoder.block.7.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
199
+ "encoder.block.7.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
200
+ "encoder.block.7.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
201
+ "encoder.block.7.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
202
+ "encoder.block.7.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
203
+ "encoder.block.7.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
204
+ "encoder.block.7.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
205
+ "encoder.block.7.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
206
+ "encoder.block.8.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
207
+ "encoder.block.8.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
208
+ "encoder.block.8.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
209
+ "encoder.block.8.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
210
+ "encoder.block.8.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
211
+ "encoder.block.8.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
212
+ "encoder.block.8.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
213
+ "encoder.block.8.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
214
+ "encoder.block.8.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
215
+ "encoder.block.9.layer.0.SelfAttention.k.weight": "model-00001-of-00002.safetensors",
216
+ "encoder.block.9.layer.0.SelfAttention.o.weight": "model-00001-of-00002.safetensors",
217
+ "encoder.block.9.layer.0.SelfAttention.q.weight": "model-00001-of-00002.safetensors",
218
+ "encoder.block.9.layer.0.SelfAttention.v.weight": "model-00001-of-00002.safetensors",
219
+ "encoder.block.9.layer.0.layer_norm.weight": "model-00001-of-00002.safetensors",
220
+ "encoder.block.9.layer.1.DenseReluDense.wi_0.weight": "model-00001-of-00002.safetensors",
221
+ "encoder.block.9.layer.1.DenseReluDense.wi_1.weight": "model-00001-of-00002.safetensors",
222
+ "encoder.block.9.layer.1.DenseReluDense.wo.weight": "model-00001-of-00002.safetensors",
223
+ "encoder.block.9.layer.1.layer_norm.weight": "model-00001-of-00002.safetensors",
224
+ "encoder.final_layer_norm.weight": "model-00002-of-00002.safetensors",
225
+ "shared.weight": "model-00001-of-00002.safetensors"
226
+ }
227
+ }
tokenizer/added_tokens.json ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "<extra_id_0>": 32099,
3
+ "<extra_id_10>": 32089,
4
+ "<extra_id_11>": 32088,
5
+ "<extra_id_12>": 32087,
6
+ "<extra_id_13>": 32086,
7
+ "<extra_id_14>": 32085,
8
+ "<extra_id_15>": 32084,
9
+ "<extra_id_16>": 32083,
10
+ "<extra_id_17>": 32082,
11
+ "<extra_id_18>": 32081,
12
+ "<extra_id_19>": 32080,
13
+ "<extra_id_1>": 32098,
14
+ "<extra_id_20>": 32079,
15
+ "<extra_id_21>": 32078,
16
+ "<extra_id_22>": 32077,
17
+ "<extra_id_23>": 32076,
18
+ "<extra_id_24>": 32075,
19
+ "<extra_id_25>": 32074,
20
+ "<extra_id_26>": 32073,
21
+ "<extra_id_27>": 32072,
22
+ "<extra_id_28>": 32071,
23
+ "<extra_id_29>": 32070,
24
+ "<extra_id_2>": 32097,
25
+ "<extra_id_30>": 32069,
26
+ "<extra_id_31>": 32068,
27
+ "<extra_id_32>": 32067,
28
+ "<extra_id_33>": 32066,
29
+ "<extra_id_34>": 32065,
30
+ "<extra_id_35>": 32064,
31
+ "<extra_id_36>": 32063,
32
+ "<extra_id_37>": 32062,
33
+ "<extra_id_38>": 32061,
34
+ "<extra_id_39>": 32060,
35
+ "<extra_id_3>": 32096,
36
+ "<extra_id_40>": 32059,
37
+ "<extra_id_41>": 32058,
38
+ "<extra_id_42>": 32057,
39
+ "<extra_id_43>": 32056,
40
+ "<extra_id_44>": 32055,
41
+ "<extra_id_45>": 32054,
42
+ "<extra_id_46>": 32053,
43
+ "<extra_id_47>": 32052,
44
+ "<extra_id_48>": 32051,
45
+ "<extra_id_49>": 32050,
46
+ "<extra_id_4>": 32095,
47
+ "<extra_id_50>": 32049,
48
+ "<extra_id_51>": 32048,
49
+ "<extra_id_52>": 32047,
50
+ "<extra_id_53>": 32046,
51
+ "<extra_id_54>": 32045,
52
+ "<extra_id_55>": 32044,
53
+ "<extra_id_56>": 32043,
54
+ "<extra_id_57>": 32042,
55
+ "<extra_id_58>": 32041,
56
+ "<extra_id_59>": 32040,
57
+ "<extra_id_5>": 32094,
58
+ "<extra_id_60>": 32039,
59
+ "<extra_id_61>": 32038,
60
+ "<extra_id_62>": 32037,
61
+ "<extra_id_63>": 32036,
62
+ "<extra_id_64>": 32035,
63
+ "<extra_id_65>": 32034,
64
+ "<extra_id_66>": 32033,
65
+ "<extra_id_67>": 32032,
66
+ "<extra_id_68>": 32031,
67
+ "<extra_id_69>": 32030,
68
+ "<extra_id_6>": 32093,
69
+ "<extra_id_70>": 32029,
70
+ "<extra_id_71>": 32028,
71
+ "<extra_id_72>": 32027,
72
+ "<extra_id_73>": 32026,
73
+ "<extra_id_74>": 32025,
74
+ "<extra_id_75>": 32024,
75
+ "<extra_id_76>": 32023,
76
+ "<extra_id_77>": 32022,
77
+ "<extra_id_78>": 32021,
78
+ "<extra_id_79>": 32020,
79
+ "<extra_id_7>": 32092,
80
+ "<extra_id_80>": 32019,
81
+ "<extra_id_81>": 32018,
82
+ "<extra_id_82>": 32017,
83
+ "<extra_id_83>": 32016,
84
+ "<extra_id_84>": 32015,
85
+ "<extra_id_85>": 32014,
86
+ "<extra_id_86>": 32013,
87
+ "<extra_id_87>": 32012,
88
+ "<extra_id_88>": 32011,
89
+ "<extra_id_89>": 32010,
90
+ "<extra_id_8>": 32091,
91
+ "<extra_id_90>": 32009,
92
+ "<extra_id_91>": 32008,
93
+ "<extra_id_92>": 32007,
94
+ "<extra_id_93>": 32006,
95
+ "<extra_id_94>": 32005,
96
+ "<extra_id_95>": 32004,
97
+ "<extra_id_96>": 32003,
98
+ "<extra_id_97>": 32002,
99
+ "<extra_id_98>": 32001,
100
+ "<extra_id_99>": 32000,
101
+ "<extra_id_9>": 32090
102
+ }
tokenizer/special_tokens_map.json ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<extra_id_0>",
4
+ "<extra_id_1>",
5
+ "<extra_id_2>",
6
+ "<extra_id_3>",
7
+ "<extra_id_4>",
8
+ "<extra_id_5>",
9
+ "<extra_id_6>",
10
+ "<extra_id_7>",
11
+ "<extra_id_8>",
12
+ "<extra_id_9>",
13
+ "<extra_id_10>",
14
+ "<extra_id_11>",
15
+ "<extra_id_12>",
16
+ "<extra_id_13>",
17
+ "<extra_id_14>",
18
+ "<extra_id_15>",
19
+ "<extra_id_16>",
20
+ "<extra_id_17>",
21
+ "<extra_id_18>",
22
+ "<extra_id_19>",
23
+ "<extra_id_20>",
24
+ "<extra_id_21>",
25
+ "<extra_id_22>",
26
+ "<extra_id_23>",
27
+ "<extra_id_24>",
28
+ "<extra_id_25>",
29
+ "<extra_id_26>",
30
+ "<extra_id_27>",
31
+ "<extra_id_28>",
32
+ "<extra_id_29>",
33
+ "<extra_id_30>",
34
+ "<extra_id_31>",
35
+ "<extra_id_32>",
36
+ "<extra_id_33>",
37
+ "<extra_id_34>",
38
+ "<extra_id_35>",
39
+ "<extra_id_36>",
40
+ "<extra_id_37>",
41
+ "<extra_id_38>",
42
+ "<extra_id_39>",
43
+ "<extra_id_40>",
44
+ "<extra_id_41>",
45
+ "<extra_id_42>",
46
+ "<extra_id_43>",
47
+ "<extra_id_44>",
48
+ "<extra_id_45>",
49
+ "<extra_id_46>",
50
+ "<extra_id_47>",
51
+ "<extra_id_48>",
52
+ "<extra_id_49>",
53
+ "<extra_id_50>",
54
+ "<extra_id_51>",
55
+ "<extra_id_52>",
56
+ "<extra_id_53>",
57
+ "<extra_id_54>",
58
+ "<extra_id_55>",
59
+ "<extra_id_56>",
60
+ "<extra_id_57>",
61
+ "<extra_id_58>",
62
+ "<extra_id_59>",
63
+ "<extra_id_60>",
64
+ "<extra_id_61>",
65
+ "<extra_id_62>",
66
+ "<extra_id_63>",
67
+ "<extra_id_64>",
68
+ "<extra_id_65>",
69
+ "<extra_id_66>",
70
+ "<extra_id_67>",
71
+ "<extra_id_68>",
72
+ "<extra_id_69>",
73
+ "<extra_id_70>",
74
+ "<extra_id_71>",
75
+ "<extra_id_72>",
76
+ "<extra_id_73>",
77
+ "<extra_id_74>",
78
+ "<extra_id_75>",
79
+ "<extra_id_76>",
80
+ "<extra_id_77>",
81
+ "<extra_id_78>",
82
+ "<extra_id_79>",
83
+ "<extra_id_80>",
84
+ "<extra_id_81>",
85
+ "<extra_id_82>",
86
+ "<extra_id_83>",
87
+ "<extra_id_84>",
88
+ "<extra_id_85>",
89
+ "<extra_id_86>",
90
+ "<extra_id_87>",
91
+ "<extra_id_88>",
92
+ "<extra_id_89>",
93
+ "<extra_id_90>",
94
+ "<extra_id_91>",
95
+ "<extra_id_92>",
96
+ "<extra_id_93>",
97
+ "<extra_id_94>",
98
+ "<extra_id_95>",
99
+ "<extra_id_96>",
100
+ "<extra_id_97>",
101
+ "<extra_id_98>",
102
+ "<extra_id_99>"
103
+ ],
104
+ "eos_token": {
105
+ "content": "</s>",
106
+ "lstrip": false,
107
+ "normalized": false,
108
+ "rstrip": false,
109
+ "single_word": false
110
+ },
111
+ "pad_token": {
112
+ "content": "<pad>",
113
+ "lstrip": false,
114
+ "normalized": false,
115
+ "rstrip": false,
116
+ "single_word": false
117
+ },
118
+ "unk_token": {
119
+ "content": "<unk>",
120
+ "lstrip": false,
121
+ "normalized": false,
122
+ "rstrip": false,
123
+ "single_word": false
124
+ }
125
+ }
tokenizer/spiece.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d60acb128cf7b7f2536e8f38a5b18a05535c9e14c7a355904270e15b0945ea86
3
+ size 791656
tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,941 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<pad>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "</s>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "<unk>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "32000": {
29
+ "content": "<extra_id_99>",
30
+ "lstrip": true,
31
+ "normalized": false,
32
+ "rstrip": true,
33
+ "single_word": true,
34
+ "special": true
35
+ },
36
+ "32001": {
37
+ "content": "<extra_id_98>",
38
+ "lstrip": true,
39
+ "normalized": false,
40
+ "rstrip": true,
41
+ "single_word": true,
42
+ "special": true
43
+ },
44
+ "32002": {
45
+ "content": "<extra_id_97>",
46
+ "lstrip": true,
47
+ "normalized": false,
48
+ "rstrip": true,
49
+ "single_word": true,
50
+ "special": true
51
+ },
52
+ "32003": {
53
+ "content": "<extra_id_96>",
54
+ "lstrip": true,
55
+ "normalized": false,
56
+ "rstrip": true,
57
+ "single_word": true,
58
+ "special": true
59
+ },
60
+ "32004": {
61
+ "content": "<extra_id_95>",
62
+ "lstrip": true,
63
+ "normalized": false,
64
+ "rstrip": true,
65
+ "single_word": true,
66
+ "special": true
67
+ },
68
+ "32005": {
69
+ "content": "<extra_id_94>",
70
+ "lstrip": true,
71
+ "normalized": false,
72
+ "rstrip": true,
73
+ "single_word": true,
74
+ "special": true
75
+ },
76
+ "32006": {
77
+ "content": "<extra_id_93>",
78
+ "lstrip": true,
79
+ "normalized": false,
80
+ "rstrip": true,
81
+ "single_word": true,
82
+ "special": true
83
+ },
84
+ "32007": {
85
+ "content": "<extra_id_92>",
86
+ "lstrip": true,
87
+ "normalized": false,
88
+ "rstrip": true,
89
+ "single_word": true,
90
+ "special": true
91
+ },
92
+ "32008": {
93
+ "content": "<extra_id_91>",
94
+ "lstrip": true,
95
+ "normalized": false,
96
+ "rstrip": true,
97
+ "single_word": true,
98
+ "special": true
99
+ },
100
+ "32009": {
101
+ "content": "<extra_id_90>",
102
+ "lstrip": true,
103
+ "normalized": false,
104
+ "rstrip": true,
105
+ "single_word": true,
106
+ "special": true
107
+ },
108
+ "32010": {
109
+ "content": "<extra_id_89>",
110
+ "lstrip": true,
111
+ "normalized": false,
112
+ "rstrip": true,
113
+ "single_word": true,
114
+ "special": true
115
+ },
116
+ "32011": {
117
+ "content": "<extra_id_88>",
118
+ "lstrip": true,
119
+ "normalized": false,
120
+ "rstrip": true,
121
+ "single_word": true,
122
+ "special": true
123
+ },
124
+ "32012": {
125
+ "content": "<extra_id_87>",
126
+ "lstrip": true,
127
+ "normalized": false,
128
+ "rstrip": true,
129
+ "single_word": true,
130
+ "special": true
131
+ },
132
+ "32013": {
133
+ "content": "<extra_id_86>",
134
+ "lstrip": true,
135
+ "normalized": false,
136
+ "rstrip": true,
137
+ "single_word": true,
138
+ "special": true
139
+ },
140
+ "32014": {
141
+ "content": "<extra_id_85>",
142
+ "lstrip": true,
143
+ "normalized": false,
144
+ "rstrip": true,
145
+ "single_word": true,
146
+ "special": true
147
+ },
148
+ "32015": {
149
+ "content": "<extra_id_84>",
150
+ "lstrip": true,
151
+ "normalized": false,
152
+ "rstrip": true,
153
+ "single_word": true,
154
+ "special": true
155
+ },
156
+ "32016": {
157
+ "content": "<extra_id_83>",
158
+ "lstrip": true,
159
+ "normalized": false,
160
+ "rstrip": true,
161
+ "single_word": true,
162
+ "special": true
163
+ },
164
+ "32017": {
165
+ "content": "<extra_id_82>",
166
+ "lstrip": true,
167
+ "normalized": false,
168
+ "rstrip": true,
169
+ "single_word": true,
170
+ "special": true
171
+ },
172
+ "32018": {
173
+ "content": "<extra_id_81>",
174
+ "lstrip": true,
175
+ "normalized": false,
176
+ "rstrip": true,
177
+ "single_word": true,
178
+ "special": true
179
+ },
180
+ "32019": {
181
+ "content": "<extra_id_80>",
182
+ "lstrip": true,
183
+ "normalized": false,
184
+ "rstrip": true,
185
+ "single_word": true,
186
+ "special": true
187
+ },
188
+ "32020": {
189
+ "content": "<extra_id_79>",
190
+ "lstrip": true,
191
+ "normalized": false,
192
+ "rstrip": true,
193
+ "single_word": true,
194
+ "special": true
195
+ },
196
+ "32021": {
197
+ "content": "<extra_id_78>",
198
+ "lstrip": true,
199
+ "normalized": false,
200
+ "rstrip": true,
201
+ "single_word": true,
202
+ "special": true
203
+ },
204
+ "32022": {
205
+ "content": "<extra_id_77>",
206
+ "lstrip": true,
207
+ "normalized": false,
208
+ "rstrip": true,
209
+ "single_word": true,
210
+ "special": true
211
+ },
212
+ "32023": {
213
+ "content": "<extra_id_76>",
214
+ "lstrip": true,
215
+ "normalized": false,
216
+ "rstrip": true,
217
+ "single_word": true,
218
+ "special": true
219
+ },
220
+ "32024": {
221
+ "content": "<extra_id_75>",
222
+ "lstrip": true,
223
+ "normalized": false,
224
+ "rstrip": true,
225
+ "single_word": true,
226
+ "special": true
227
+ },
228
+ "32025": {
229
+ "content": "<extra_id_74>",
230
+ "lstrip": true,
231
+ "normalized": false,
232
+ "rstrip": true,
233
+ "single_word": true,
234
+ "special": true
235
+ },
236
+ "32026": {
237
+ "content": "<extra_id_73>",
238
+ "lstrip": true,
239
+ "normalized": false,
240
+ "rstrip": true,
241
+ "single_word": true,
242
+ "special": true
243
+ },
244
+ "32027": {
245
+ "content": "<extra_id_72>",
246
+ "lstrip": true,
247
+ "normalized": false,
248
+ "rstrip": true,
249
+ "single_word": true,
250
+ "special": true
251
+ },
252
+ "32028": {
253
+ "content": "<extra_id_71>",
254
+ "lstrip": true,
255
+ "normalized": false,
256
+ "rstrip": true,
257
+ "single_word": true,
258
+ "special": true
259
+ },
260
+ "32029": {
261
+ "content": "<extra_id_70>",
262
+ "lstrip": true,
263
+ "normalized": false,
264
+ "rstrip": true,
265
+ "single_word": true,
266
+ "special": true
267
+ },
268
+ "32030": {
269
+ "content": "<extra_id_69>",
270
+ "lstrip": true,
271
+ "normalized": false,
272
+ "rstrip": true,
273
+ "single_word": true,
274
+ "special": true
275
+ },
276
+ "32031": {
277
+ "content": "<extra_id_68>",
278
+ "lstrip": true,
279
+ "normalized": false,
280
+ "rstrip": true,
281
+ "single_word": true,
282
+ "special": true
283
+ },
284
+ "32032": {
285
+ "content": "<extra_id_67>",
286
+ "lstrip": true,
287
+ "normalized": false,
288
+ "rstrip": true,
289
+ "single_word": true,
290
+ "special": true
291
+ },
292
+ "32033": {
293
+ "content": "<extra_id_66>",
294
+ "lstrip": true,
295
+ "normalized": false,
296
+ "rstrip": true,
297
+ "single_word": true,
298
+ "special": true
299
+ },
300
+ "32034": {
301
+ "content": "<extra_id_65>",
302
+ "lstrip": true,
303
+ "normalized": false,
304
+ "rstrip": true,
305
+ "single_word": true,
306
+ "special": true
307
+ },
308
+ "32035": {
309
+ "content": "<extra_id_64>",
310
+ "lstrip": true,
311
+ "normalized": false,
312
+ "rstrip": true,
313
+ "single_word": true,
314
+ "special": true
315
+ },
316
+ "32036": {
317
+ "content": "<extra_id_63>",
318
+ "lstrip": true,
319
+ "normalized": false,
320
+ "rstrip": true,
321
+ "single_word": true,
322
+ "special": true
323
+ },
324
+ "32037": {
325
+ "content": "<extra_id_62>",
326
+ "lstrip": true,
327
+ "normalized": false,
328
+ "rstrip": true,
329
+ "single_word": true,
330
+ "special": true
331
+ },
332
+ "32038": {
333
+ "content": "<extra_id_61>",
334
+ "lstrip": true,
335
+ "normalized": false,
336
+ "rstrip": true,
337
+ "single_word": true,
338
+ "special": true
339
+ },
340
+ "32039": {
341
+ "content": "<extra_id_60>",
342
+ "lstrip": true,
343
+ "normalized": false,
344
+ "rstrip": true,
345
+ "single_word": true,
346
+ "special": true
347
+ },
348
+ "32040": {
349
+ "content": "<extra_id_59>",
350
+ "lstrip": true,
351
+ "normalized": false,
352
+ "rstrip": true,
353
+ "single_word": true,
354
+ "special": true
355
+ },
356
+ "32041": {
357
+ "content": "<extra_id_58>",
358
+ "lstrip": true,
359
+ "normalized": false,
360
+ "rstrip": true,
361
+ "single_word": true,
362
+ "special": true
363
+ },
364
+ "32042": {
365
+ "content": "<extra_id_57>",
366
+ "lstrip": true,
367
+ "normalized": false,
368
+ "rstrip": true,
369
+ "single_word": true,
370
+ "special": true
371
+ },
372
+ "32043": {
373
+ "content": "<extra_id_56>",
374
+ "lstrip": true,
375
+ "normalized": false,
376
+ "rstrip": true,
377
+ "single_word": true,
378
+ "special": true
379
+ },
380
+ "32044": {
381
+ "content": "<extra_id_55>",
382
+ "lstrip": true,
383
+ "normalized": false,
384
+ "rstrip": true,
385
+ "single_word": true,
386
+ "special": true
387
+ },
388
+ "32045": {
389
+ "content": "<extra_id_54>",
390
+ "lstrip": true,
391
+ "normalized": false,
392
+ "rstrip": true,
393
+ "single_word": true,
394
+ "special": true
395
+ },
396
+ "32046": {
397
+ "content": "<extra_id_53>",
398
+ "lstrip": true,
399
+ "normalized": false,
400
+ "rstrip": true,
401
+ "single_word": true,
402
+ "special": true
403
+ },
404
+ "32047": {
405
+ "content": "<extra_id_52>",
406
+ "lstrip": true,
407
+ "normalized": false,
408
+ "rstrip": true,
409
+ "single_word": true,
410
+ "special": true
411
+ },
412
+ "32048": {
413
+ "content": "<extra_id_51>",
414
+ "lstrip": true,
415
+ "normalized": false,
416
+ "rstrip": true,
417
+ "single_word": true,
418
+ "special": true
419
+ },
420
+ "32049": {
421
+ "content": "<extra_id_50>",
422
+ "lstrip": true,
423
+ "normalized": false,
424
+ "rstrip": true,
425
+ "single_word": true,
426
+ "special": true
427
+ },
428
+ "32050": {
429
+ "content": "<extra_id_49>",
430
+ "lstrip": true,
431
+ "normalized": false,
432
+ "rstrip": true,
433
+ "single_word": true,
434
+ "special": true
435
+ },
436
+ "32051": {
437
+ "content": "<extra_id_48>",
438
+ "lstrip": true,
439
+ "normalized": false,
440
+ "rstrip": true,
441
+ "single_word": true,
442
+ "special": true
443
+ },
444
+ "32052": {
445
+ "content": "<extra_id_47>",
446
+ "lstrip": true,
447
+ "normalized": false,
448
+ "rstrip": true,
449
+ "single_word": true,
450
+ "special": true
451
+ },
452
+ "32053": {
453
+ "content": "<extra_id_46>",
454
+ "lstrip": true,
455
+ "normalized": false,
456
+ "rstrip": true,
457
+ "single_word": true,
458
+ "special": true
459
+ },
460
+ "32054": {
461
+ "content": "<extra_id_45>",
462
+ "lstrip": true,
463
+ "normalized": false,
464
+ "rstrip": true,
465
+ "single_word": true,
466
+ "special": true
467
+ },
468
+ "32055": {
469
+ "content": "<extra_id_44>",
470
+ "lstrip": true,
471
+ "normalized": false,
472
+ "rstrip": true,
473
+ "single_word": true,
474
+ "special": true
475
+ },
476
+ "32056": {
477
+ "content": "<extra_id_43>",
478
+ "lstrip": true,
479
+ "normalized": false,
480
+ "rstrip": true,
481
+ "single_word": true,
482
+ "special": true
483
+ },
484
+ "32057": {
485
+ "content": "<extra_id_42>",
486
+ "lstrip": true,
487
+ "normalized": false,
488
+ "rstrip": true,
489
+ "single_word": true,
490
+ "special": true
491
+ },
492
+ "32058": {
493
+ "content": "<extra_id_41>",
494
+ "lstrip": true,
495
+ "normalized": false,
496
+ "rstrip": true,
497
+ "single_word": true,
498
+ "special": true
499
+ },
500
+ "32059": {
501
+ "content": "<extra_id_40>",
502
+ "lstrip": true,
503
+ "normalized": false,
504
+ "rstrip": true,
505
+ "single_word": true,
506
+ "special": true
507
+ },
508
+ "32060": {
509
+ "content": "<extra_id_39>",
510
+ "lstrip": true,
511
+ "normalized": false,
512
+ "rstrip": true,
513
+ "single_word": true,
514
+ "special": true
515
+ },
516
+ "32061": {
517
+ "content": "<extra_id_38>",
518
+ "lstrip": true,
519
+ "normalized": false,
520
+ "rstrip": true,
521
+ "single_word": true,
522
+ "special": true
523
+ },
524
+ "32062": {
525
+ "content": "<extra_id_37>",
526
+ "lstrip": true,
527
+ "normalized": false,
528
+ "rstrip": true,
529
+ "single_word": true,
530
+ "special": true
531
+ },
532
+ "32063": {
533
+ "content": "<extra_id_36>",
534
+ "lstrip": true,
535
+ "normalized": false,
536
+ "rstrip": true,
537
+ "single_word": true,
538
+ "special": true
539
+ },
540
+ "32064": {
541
+ "content": "<extra_id_35>",
542
+ "lstrip": true,
543
+ "normalized": false,
544
+ "rstrip": true,
545
+ "single_word": true,
546
+ "special": true
547
+ },
548
+ "32065": {
549
+ "content": "<extra_id_34>",
550
+ "lstrip": true,
551
+ "normalized": false,
552
+ "rstrip": true,
553
+ "single_word": true,
554
+ "special": true
555
+ },
556
+ "32066": {
557
+ "content": "<extra_id_33>",
558
+ "lstrip": true,
559
+ "normalized": false,
560
+ "rstrip": true,
561
+ "single_word": true,
562
+ "special": true
563
+ },
564
+ "32067": {
565
+ "content": "<extra_id_32>",
566
+ "lstrip": true,
567
+ "normalized": false,
568
+ "rstrip": true,
569
+ "single_word": true,
570
+ "special": true
571
+ },
572
+ "32068": {
573
+ "content": "<extra_id_31>",
574
+ "lstrip": true,
575
+ "normalized": false,
576
+ "rstrip": true,
577
+ "single_word": true,
578
+ "special": true
579
+ },
580
+ "32069": {
581
+ "content": "<extra_id_30>",
582
+ "lstrip": true,
583
+ "normalized": false,
584
+ "rstrip": true,
585
+ "single_word": true,
586
+ "special": true
587
+ },
588
+ "32070": {
589
+ "content": "<extra_id_29>",
590
+ "lstrip": true,
591
+ "normalized": false,
592
+ "rstrip": true,
593
+ "single_word": true,
594
+ "special": true
595
+ },
596
+ "32071": {
597
+ "content": "<extra_id_28>",
598
+ "lstrip": true,
599
+ "normalized": false,
600
+ "rstrip": true,
601
+ "single_word": true,
602
+ "special": true
603
+ },
604
+ "32072": {
605
+ "content": "<extra_id_27>",
606
+ "lstrip": true,
607
+ "normalized": false,
608
+ "rstrip": true,
609
+ "single_word": true,
610
+ "special": true
611
+ },
612
+ "32073": {
613
+ "content": "<extra_id_26>",
614
+ "lstrip": true,
615
+ "normalized": false,
616
+ "rstrip": true,
617
+ "single_word": true,
618
+ "special": true
619
+ },
620
+ "32074": {
621
+ "content": "<extra_id_25>",
622
+ "lstrip": true,
623
+ "normalized": false,
624
+ "rstrip": true,
625
+ "single_word": true,
626
+ "special": true
627
+ },
628
+ "32075": {
629
+ "content": "<extra_id_24>",
630
+ "lstrip": true,
631
+ "normalized": false,
632
+ "rstrip": true,
633
+ "single_word": true,
634
+ "special": true
635
+ },
636
+ "32076": {
637
+ "content": "<extra_id_23>",
638
+ "lstrip": true,
639
+ "normalized": false,
640
+ "rstrip": true,
641
+ "single_word": true,
642
+ "special": true
643
+ },
644
+ "32077": {
645
+ "content": "<extra_id_22>",
646
+ "lstrip": true,
647
+ "normalized": false,
648
+ "rstrip": true,
649
+ "single_word": true,
650
+ "special": true
651
+ },
652
+ "32078": {
653
+ "content": "<extra_id_21>",
654
+ "lstrip": true,
655
+ "normalized": false,
656
+ "rstrip": true,
657
+ "single_word": true,
658
+ "special": true
659
+ },
660
+ "32079": {
661
+ "content": "<extra_id_20>",
662
+ "lstrip": true,
663
+ "normalized": false,
664
+ "rstrip": true,
665
+ "single_word": true,
666
+ "special": true
667
+ },
668
+ "32080": {
669
+ "content": "<extra_id_19>",
670
+ "lstrip": true,
671
+ "normalized": false,
672
+ "rstrip": true,
673
+ "single_word": true,
674
+ "special": true
675
+ },
676
+ "32081": {
677
+ "content": "<extra_id_18>",
678
+ "lstrip": true,
679
+ "normalized": false,
680
+ "rstrip": true,
681
+ "single_word": true,
682
+ "special": true
683
+ },
684
+ "32082": {
685
+ "content": "<extra_id_17>",
686
+ "lstrip": true,
687
+ "normalized": false,
688
+ "rstrip": true,
689
+ "single_word": true,
690
+ "special": true
691
+ },
692
+ "32083": {
693
+ "content": "<extra_id_16>",
694
+ "lstrip": true,
695
+ "normalized": false,
696
+ "rstrip": true,
697
+ "single_word": true,
698
+ "special": true
699
+ },
700
+ "32084": {
701
+ "content": "<extra_id_15>",
702
+ "lstrip": true,
703
+ "normalized": false,
704
+ "rstrip": true,
705
+ "single_word": true,
706
+ "special": true
707
+ },
708
+ "32085": {
709
+ "content": "<extra_id_14>",
710
+ "lstrip": true,
711
+ "normalized": false,
712
+ "rstrip": true,
713
+ "single_word": true,
714
+ "special": true
715
+ },
716
+ "32086": {
717
+ "content": "<extra_id_13>",
718
+ "lstrip": true,
719
+ "normalized": false,
720
+ "rstrip": true,
721
+ "single_word": true,
722
+ "special": true
723
+ },
724
+ "32087": {
725
+ "content": "<extra_id_12>",
726
+ "lstrip": true,
727
+ "normalized": false,
728
+ "rstrip": true,
729
+ "single_word": true,
730
+ "special": true
731
+ },
732
+ "32088": {
733
+ "content": "<extra_id_11>",
734
+ "lstrip": true,
735
+ "normalized": false,
736
+ "rstrip": true,
737
+ "single_word": true,
738
+ "special": true
739
+ },
740
+ "32089": {
741
+ "content": "<extra_id_10>",
742
+ "lstrip": true,
743
+ "normalized": false,
744
+ "rstrip": true,
745
+ "single_word": true,
746
+ "special": true
747
+ },
748
+ "32090": {
749
+ "content": "<extra_id_9>",
750
+ "lstrip": true,
751
+ "normalized": false,
752
+ "rstrip": true,
753
+ "single_word": true,
754
+ "special": true
755
+ },
756
+ "32091": {
757
+ "content": "<extra_id_8>",
758
+ "lstrip": true,
759
+ "normalized": false,
760
+ "rstrip": true,
761
+ "single_word": true,
762
+ "special": true
763
+ },
764
+ "32092": {
765
+ "content": "<extra_id_7>",
766
+ "lstrip": true,
767
+ "normalized": false,
768
+ "rstrip": true,
769
+ "single_word": true,
770
+ "special": true
771
+ },
772
+ "32093": {
773
+ "content": "<extra_id_6>",
774
+ "lstrip": true,
775
+ "normalized": false,
776
+ "rstrip": true,
777
+ "single_word": true,
778
+ "special": true
779
+ },
780
+ "32094": {
781
+ "content": "<extra_id_5>",
782
+ "lstrip": true,
783
+ "normalized": false,
784
+ "rstrip": true,
785
+ "single_word": true,
786
+ "special": true
787
+ },
788
+ "32095": {
789
+ "content": "<extra_id_4>",
790
+ "lstrip": true,
791
+ "normalized": false,
792
+ "rstrip": true,
793
+ "single_word": true,
794
+ "special": true
795
+ },
796
+ "32096": {
797
+ "content": "<extra_id_3>",
798
+ "lstrip": true,
799
+ "normalized": false,
800
+ "rstrip": true,
801
+ "single_word": true,
802
+ "special": true
803
+ },
804
+ "32097": {
805
+ "content": "<extra_id_2>",
806
+ "lstrip": true,
807
+ "normalized": false,
808
+ "rstrip": true,
809
+ "single_word": true,
810
+ "special": true
811
+ },
812
+ "32098": {
813
+ "content": "<extra_id_1>",
814
+ "lstrip": true,
815
+ "normalized": false,
816
+ "rstrip": true,
817
+ "single_word": true,
818
+ "special": true
819
+ },
820
+ "32099": {
821
+ "content": "<extra_id_0>",
822
+ "lstrip": true,
823
+ "normalized": false,
824
+ "rstrip": true,
825
+ "single_word": true,
826
+ "special": true
827
+ }
828
+ },
829
+ "additional_special_tokens": [
830
+ "<extra_id_0>",
831
+ "<extra_id_1>",
832
+ "<extra_id_2>",
833
+ "<extra_id_3>",
834
+ "<extra_id_4>",
835
+ "<extra_id_5>",
836
+ "<extra_id_6>",
837
+ "<extra_id_7>",
838
+ "<extra_id_8>",
839
+ "<extra_id_9>",
840
+ "<extra_id_10>",
841
+ "<extra_id_11>",
842
+ "<extra_id_12>",
843
+ "<extra_id_13>",
844
+ "<extra_id_14>",
845
+ "<extra_id_15>",
846
+ "<extra_id_16>",
847
+ "<extra_id_17>",
848
+ "<extra_id_18>",
849
+ "<extra_id_19>",
850
+ "<extra_id_20>",
851
+ "<extra_id_21>",
852
+ "<extra_id_22>",
853
+ "<extra_id_23>",
854
+ "<extra_id_24>",
855
+ "<extra_id_25>",
856
+ "<extra_id_26>",
857
+ "<extra_id_27>",
858
+ "<extra_id_28>",
859
+ "<extra_id_29>",
860
+ "<extra_id_30>",
861
+ "<extra_id_31>",
862
+ "<extra_id_32>",
863
+ "<extra_id_33>",
864
+ "<extra_id_34>",
865
+ "<extra_id_35>",
866
+ "<extra_id_36>",
867
+ "<extra_id_37>",
868
+ "<extra_id_38>",
869
+ "<extra_id_39>",
870
+ "<extra_id_40>",
871
+ "<extra_id_41>",
872
+ "<extra_id_42>",
873
+ "<extra_id_43>",
874
+ "<extra_id_44>",
875
+ "<extra_id_45>",
876
+ "<extra_id_46>",
877
+ "<extra_id_47>",
878
+ "<extra_id_48>",
879
+ "<extra_id_49>",
880
+ "<extra_id_50>",
881
+ "<extra_id_51>",
882
+ "<extra_id_52>",
883
+ "<extra_id_53>",
884
+ "<extra_id_54>",
885
+ "<extra_id_55>",
886
+ "<extra_id_56>",
887
+ "<extra_id_57>",
888
+ "<extra_id_58>",
889
+ "<extra_id_59>",
890
+ "<extra_id_60>",
891
+ "<extra_id_61>",
892
+ "<extra_id_62>",
893
+ "<extra_id_63>",
894
+ "<extra_id_64>",
895
+ "<extra_id_65>",
896
+ "<extra_id_66>",
897
+ "<extra_id_67>",
898
+ "<extra_id_68>",
899
+ "<extra_id_69>",
900
+ "<extra_id_70>",
901
+ "<extra_id_71>",
902
+ "<extra_id_72>",
903
+ "<extra_id_73>",
904
+ "<extra_id_74>",
905
+ "<extra_id_75>",
906
+ "<extra_id_76>",
907
+ "<extra_id_77>",
908
+ "<extra_id_78>",
909
+ "<extra_id_79>",
910
+ "<extra_id_80>",
911
+ "<extra_id_81>",
912
+ "<extra_id_82>",
913
+ "<extra_id_83>",
914
+ "<extra_id_84>",
915
+ "<extra_id_85>",
916
+ "<extra_id_86>",
917
+ "<extra_id_87>",
918
+ "<extra_id_88>",
919
+ "<extra_id_89>",
920
+ "<extra_id_90>",
921
+ "<extra_id_91>",
922
+ "<extra_id_92>",
923
+ "<extra_id_93>",
924
+ "<extra_id_94>",
925
+ "<extra_id_95>",
926
+ "<extra_id_96>",
927
+ "<extra_id_97>",
928
+ "<extra_id_98>",
929
+ "<extra_id_99>"
930
+ ],
931
+ "clean_up_tokenization_spaces": true,
932
+ "eos_token": "</s>",
933
+ "extra_ids": 100,
934
+ "extra_special_tokens": {},
935
+ "legacy": true,
936
+ "model_max_length": 512,
937
+ "pad_token": "<pad>",
938
+ "sp_model_kwargs": {},
939
+ "tokenizer_class": "T5Tokenizer",
940
+ "unk_token": "<unk>"
941
+ }
transformer/config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "RSEditModifiedPixArtTransformer2DModel",
3
+ "_diffusers_version": "0.36.0",
4
+ "_name_or_path": "/data/models/hf_models/PixArt-alpha/PixArt-XL-2-512x512",
5
+ "activation_fn": "gelu-approximate",
6
+ "attention_bias": true,
7
+ "attention_head_dim": 72,
8
+ "attention_type": "default",
9
+ "caption_channels": 4096,
10
+ "cross_attention_dim": 1152,
11
+ "double_self_attention": false,
12
+ "dropout": 0.0,
13
+ "in_channels": 4,
14
+ "interpolation_scale": null,
15
+ "norm_elementwise_affine": false,
16
+ "norm_eps": 1e-06,
17
+ "norm_num_groups": 32,
18
+ "norm_type": "ada_norm_single",
19
+ "num_attention_heads": 16,
20
+ "num_embeds_ada_norm": 1000,
21
+ "num_layers": 28,
22
+ "num_vector_embeds": null,
23
+ "only_cross_attention": false,
24
+ "out_channels": 8,
25
+ "patch_size": 2,
26
+ "rsedit_modified_dit": true,
27
+ "rsedit_window_size": 8,
28
+ "rsedit_window_skip_every": 1,
29
+ "sample_size": 64,
30
+ "upcast_attention": false,
31
+ "use_additional_conditions": null,
32
+ "use_linear_projection": false
33
+ }
transformer/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9d3c1f951f58ab1024b6bb4dd9da4331404194573e13949f3d204c4a54e3085
3
+ size 2448140648
vae/config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "AutoencoderKL",
3
+ "_diffusers_version": "0.36.0.dev0",
4
+ "_name_or_path": "/data/models/hf_models/PixArt-alpha/PixArt-XL-2-512x512",
5
+ "act_fn": "silu",
6
+ "block_out_channels": [
7
+ 128,
8
+ 256,
9
+ 512,
10
+ 512
11
+ ],
12
+ "down_block_types": [
13
+ "DownEncoderBlock2D",
14
+ "DownEncoderBlock2D",
15
+ "DownEncoderBlock2D",
16
+ "DownEncoderBlock2D"
17
+ ],
18
+ "force_upcast": true,
19
+ "in_channels": 3,
20
+ "latent_channels": 4,
21
+ "latents_mean": null,
22
+ "latents_std": null,
23
+ "layers_per_block": 2,
24
+ "mid_block_add_attention": true,
25
+ "norm_num_groups": 32,
26
+ "out_channels": 3,
27
+ "sample_size": 256,
28
+ "scaling_factor": 0.18215,
29
+ "shift_factor": null,
30
+ "up_block_types": [
31
+ "UpDecoderBlock2D",
32
+ "UpDecoderBlock2D",
33
+ "UpDecoderBlock2D",
34
+ "UpDecoderBlock2D"
35
+ ],
36
+ "use_post_quant_conv": true,
37
+ "use_quant_conv": true
38
+ }
vae/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1d6de79b2229c59391de90d1a27aa62f4cc5423cc82621ad2307206007fa965e
3
+ size 167335590