ShineChen1024
commited on
Commit
•
cac8ae4
1
Parent(s):
2128b98
Upload 15 files
Browse files- miaobi_beta0.9/feature_extractor/preprocessor_config.json +27 -0
- miaobi_beta0.9/model_index.json +38 -0
- miaobi_beta0.9/safety_checker/config.json +28 -0
- miaobi_beta0.9/safety_checker/model.safetensors +3 -0
- miaobi_beta0.9/scheduler/scheduler_config.json +25 -0
- miaobi_beta0.9/text_encoder/config.json +25 -0
- miaobi_beta0.9/text_encoder/model.safetensors +3 -0
- miaobi_beta0.9/tokenizer/clip_tokenizer_roberta.py +246 -0
- miaobi_beta0.9/tokenizer/special_tokens_map.json +37 -0
- miaobi_beta0.9/tokenizer/tokenizer_config.json +64 -0
- miaobi_beta0.9/tokenizer/vocab.txt +0 -0
- miaobi_beta0.9/unet/config.json +75 -0
- miaobi_beta0.9/unet/diffusion_pytorch_model.safetensors +3 -0
- miaobi_beta0.9/vae/config.json +32 -0
- miaobi_beta0.9/vae/diffusion_pytorch_model.safetensors +3 -0
miaobi_beta0.9/feature_extractor/preprocessor_config.json
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"crop_size": {
|
3 |
+
"height": 224,
|
4 |
+
"width": 224
|
5 |
+
},
|
6 |
+
"do_center_crop": true,
|
7 |
+
"do_convert_rgb": true,
|
8 |
+
"do_normalize": true,
|
9 |
+
"do_rescale": true,
|
10 |
+
"do_resize": true,
|
11 |
+
"image_mean": [
|
12 |
+
0.48145466,
|
13 |
+
0.4578275,
|
14 |
+
0.40821073
|
15 |
+
],
|
16 |
+
"image_processor_type": "CLIPImageProcessor",
|
17 |
+
"image_std": [
|
18 |
+
0.26862954,
|
19 |
+
0.26130258,
|
20 |
+
0.27577711
|
21 |
+
],
|
22 |
+
"resample": 3,
|
23 |
+
"rescale_factor": 0.00392156862745098,
|
24 |
+
"size": {
|
25 |
+
"shortest_edge": 224
|
26 |
+
}
|
27 |
+
}
|
miaobi_beta0.9/model_index.json
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "StableDiffusionPipeline",
|
3 |
+
"_diffusers_version": "0.26.3",
|
4 |
+
"_name_or_path": "E:/text_invert/HiPer/stable-diffusion-v1-4",
|
5 |
+
"feature_extractor": [
|
6 |
+
"transformers",
|
7 |
+
"CLIPImageProcessor"
|
8 |
+
],
|
9 |
+
"image_encoder": [
|
10 |
+
null,
|
11 |
+
null
|
12 |
+
],
|
13 |
+
"requires_safety_checker": true,
|
14 |
+
"safety_checker": [
|
15 |
+
"stable_diffusion",
|
16 |
+
"StableDiffusionSafetyChecker"
|
17 |
+
],
|
18 |
+
"scheduler": [
|
19 |
+
"diffusers",
|
20 |
+
"UniPCMultistepScheduler"
|
21 |
+
],
|
22 |
+
"text_encoder": [
|
23 |
+
"transformers",
|
24 |
+
"CLIPTextModel"
|
25 |
+
],
|
26 |
+
"tokenizer": [
|
27 |
+
"transformers_modules.tokenizer.clip_tokenizer_roberta",
|
28 |
+
"CLIPTokenizerRoberta"
|
29 |
+
],
|
30 |
+
"unet": [
|
31 |
+
"diffusers",
|
32 |
+
"UNet2DConditionModel"
|
33 |
+
],
|
34 |
+
"vae": [
|
35 |
+
"diffusers",
|
36 |
+
"AutoencoderKL"
|
37 |
+
]
|
38 |
+
}
|
miaobi_beta0.9/safety_checker/config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "E:/text_invert/HiPer/stable-diffusion-v1-4\\safety_checker",
|
3 |
+
"architectures": [
|
4 |
+
"StableDiffusionSafetyChecker"
|
5 |
+
],
|
6 |
+
"initializer_factor": 1.0,
|
7 |
+
"logit_scale_init_value": 2.6592,
|
8 |
+
"model_type": "clip",
|
9 |
+
"projection_dim": 768,
|
10 |
+
"text_config": {
|
11 |
+
"dropout": 0.0,
|
12 |
+
"hidden_size": 768,
|
13 |
+
"intermediate_size": 3072,
|
14 |
+
"model_type": "clip_text_model",
|
15 |
+
"num_attention_heads": 12
|
16 |
+
},
|
17 |
+
"torch_dtype": "float16",
|
18 |
+
"transformers_version": "4.38.1",
|
19 |
+
"vision_config": {
|
20 |
+
"dropout": 0.0,
|
21 |
+
"hidden_size": 1024,
|
22 |
+
"intermediate_size": 4096,
|
23 |
+
"model_type": "clip_vision_model",
|
24 |
+
"num_attention_heads": 16,
|
25 |
+
"num_hidden_layers": 24,
|
26 |
+
"patch_size": 14
|
27 |
+
}
|
28 |
+
}
|
miaobi_beta0.9/safety_checker/model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:57ecdfa243b170f9b4cb3eefaf0f64552ef78fc0bf0eb1c5b9675308447184f6
|
3 |
+
size 608016280
|
miaobi_beta0.9/scheduler/scheduler_config.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "UniPCMultistepScheduler",
|
3 |
+
"_diffusers_version": "0.26.3",
|
4 |
+
"beta_end": 0.012,
|
5 |
+
"beta_schedule": "scaled_linear",
|
6 |
+
"beta_start": 0.00085,
|
7 |
+
"clip_sample": false,
|
8 |
+
"disable_corrector": [],
|
9 |
+
"dynamic_thresholding_ratio": 0.995,
|
10 |
+
"lower_order_final": true,
|
11 |
+
"num_train_timesteps": 1000,
|
12 |
+
"predict_x0": true,
|
13 |
+
"prediction_type": "epsilon",
|
14 |
+
"sample_max_value": 1.0,
|
15 |
+
"set_alpha_to_one": false,
|
16 |
+
"skip_prk_steps": true,
|
17 |
+
"solver_order": 2,
|
18 |
+
"solver_p": null,
|
19 |
+
"solver_type": "bh2",
|
20 |
+
"steps_offset": 1,
|
21 |
+
"thresholding": false,
|
22 |
+
"timestep_spacing": "linspace",
|
23 |
+
"trained_betas": null,
|
24 |
+
"use_karras_sigmas": false
|
25 |
+
}
|
miaobi_beta0.9/text_encoder/config.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "C:/Users/user/Desktop/fsdownload/miaobi/",
|
3 |
+
"architectures": [
|
4 |
+
"CLIPTextModel"
|
5 |
+
],
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"bos_token_id": 49406,
|
8 |
+
"dropout": 0.0,
|
9 |
+
"eos_token_id": 49407,
|
10 |
+
"hidden_act": "quick_gelu",
|
11 |
+
"hidden_size": 768,
|
12 |
+
"initializer_factor": 1.0,
|
13 |
+
"initializer_range": 0.02,
|
14 |
+
"intermediate_size": 3072,
|
15 |
+
"layer_norm_eps": 1e-05,
|
16 |
+
"max_position_embeddings": 77,
|
17 |
+
"model_type": "clip_text_model",
|
18 |
+
"num_attention_heads": 12,
|
19 |
+
"num_hidden_layers": 12,
|
20 |
+
"pad_token_id": 1,
|
21 |
+
"projection_dim": 768,
|
22 |
+
"torch_dtype": "float16",
|
23 |
+
"transformers_version": "4.38.1",
|
24 |
+
"vocab_size": 49408
|
25 |
+
}
|
miaobi_beta0.9/text_encoder/model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:15ca03980fd78ec927995d0874cc43c3d090ea154c0b4963dda08dc26578a625
|
3 |
+
size 246144152
|
miaobi_beta0.9/tokenizer/clip_tokenizer_roberta.py
ADDED
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers.models.bert.tokenization_bert import *
|
2 |
+
import os
|
3 |
+
|
4 |
+
|
5 |
+
class CLIPTokenizerRoberta(PreTrainedTokenizer):
|
6 |
+
r"""
|
7 |
+
Construct a BERT tokenizer. Based on WordPiece.
|
8 |
+
|
9 |
+
This tokenizer inherits from [`PreTrainedTokenizer`] which contains most of the main methods. Users should refer to
|
10 |
+
this superclass for more information regarding those methods.
|
11 |
+
|
12 |
+
Args:
|
13 |
+
vocab_file (`str`):
|
14 |
+
File containing the vocabulary.
|
15 |
+
do_lower_case (`bool`, *optional*, defaults to `True`):
|
16 |
+
Whether or not to lowercase the input when tokenizing.
|
17 |
+
do_basic_tokenize (`bool`, *optional*, defaults to `True`):
|
18 |
+
Whether or not to do basic tokenization before WordPiece.
|
19 |
+
never_split (`Iterable`, *optional*):
|
20 |
+
Collection of tokens which will never be split during tokenization. Only has an effect when
|
21 |
+
`do_basic_tokenize=True`
|
22 |
+
unk_token (`str`, *optional*, defaults to `"[UNK]"`):
|
23 |
+
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
|
24 |
+
token instead.
|
25 |
+
sep_token (`str`, *optional*, defaults to `"[SEP]"`):
|
26 |
+
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
|
27 |
+
sequence classification or for a text and a question for question answering. It is also used as the last
|
28 |
+
token of a sequence built with special tokens.
|
29 |
+
pad_token (`str`, *optional*, defaults to `"[PAD]"`):
|
30 |
+
The token used for padding, for example when batching sequences of different lengths.
|
31 |
+
cls_token (`str`, *optional*, defaults to `"[CLS]"`):
|
32 |
+
The classifier token which is used when doing sequence classification (classification of the whole sequence
|
33 |
+
instead of per-token classification). It is the first token of the sequence when built with special tokens.
|
34 |
+
mask_token (`str`, *optional*, defaults to `"[MASK]"`):
|
35 |
+
The token used for masking values. This is the token used when training this model with masked language
|
36 |
+
modeling. This is the token which the model will try to predict.
|
37 |
+
tokenize_chinese_chars (`bool`, *optional*, defaults to `True`):
|
38 |
+
Whether or not to tokenize Chinese characters.
|
39 |
+
|
40 |
+
This should likely be deactivated for Japanese (see this
|
41 |
+
[issue](https://github.com/huggingface/transformers/issues/328)).
|
42 |
+
strip_accents (`bool`, *optional*):
|
43 |
+
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
|
44 |
+
value for `lowercase` (as in the original BERT).
|
45 |
+
"""
|
46 |
+
|
47 |
+
vocab_files_names = VOCAB_FILES_NAMES
|
48 |
+
pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP
|
49 |
+
pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION
|
50 |
+
max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
|
51 |
+
|
52 |
+
def __init__(
|
53 |
+
self,
|
54 |
+
vocab_file,
|
55 |
+
do_lower_case=True,
|
56 |
+
do_basic_tokenize=True,
|
57 |
+
never_split=None,
|
58 |
+
unk_token="[UNK]",
|
59 |
+
sep_token="[SEP]",
|
60 |
+
pad_token="[PAD]",
|
61 |
+
cls_token="[CLS]",
|
62 |
+
mask_token="[MASK]",
|
63 |
+
tokenize_chinese_chars=True,
|
64 |
+
strip_accents=None,
|
65 |
+
**kwargs
|
66 |
+
):
|
67 |
+
if not os.path.isfile(vocab_file):
|
68 |
+
raise ValueError(
|
69 |
+
f"Can't find a vocabulary file at path '{vocab_file}'. To load the vocabulary from a Google pretrained"
|
70 |
+
" model use `tokenizer = BertTokenizer.from_pretrained(PRETRAINED_MODEL_NAME)`"
|
71 |
+
)
|
72 |
+
self.vocab = load_vocab(vocab_file)
|
73 |
+
self.ids_to_tokens = collections.OrderedDict([(ids, tok) for tok, ids in self.vocab.items()])
|
74 |
+
self.do_basic_tokenize = do_basic_tokenize
|
75 |
+
if do_basic_tokenize:
|
76 |
+
self.basic_tokenizer = BasicTokenizer(
|
77 |
+
do_lower_case=do_lower_case,
|
78 |
+
never_split=never_split,
|
79 |
+
tokenize_chinese_chars=tokenize_chinese_chars,
|
80 |
+
strip_accents=strip_accents,
|
81 |
+
)
|
82 |
+
self.wordpiece_tokenizer = WordpieceTokenizer(vocab=self.vocab, unk_token=str(unk_token))
|
83 |
+
|
84 |
+
super().__init__(
|
85 |
+
do_lower_case=do_lower_case,
|
86 |
+
do_basic_tokenize=do_basic_tokenize,
|
87 |
+
never_split=never_split,
|
88 |
+
unk_token=unk_token,
|
89 |
+
sep_token=sep_token,
|
90 |
+
pad_token=pad_token,
|
91 |
+
cls_token=cls_token,
|
92 |
+
mask_token=mask_token,
|
93 |
+
tokenize_chinese_chars=tokenize_chinese_chars,
|
94 |
+
strip_accents=strip_accents,
|
95 |
+
**kwargs,
|
96 |
+
)
|
97 |
+
|
98 |
+
@property
|
99 |
+
def do_lower_case(self):
|
100 |
+
return self.basic_tokenizer.do_lower_case
|
101 |
+
|
102 |
+
@property
|
103 |
+
def vocab_size(self):
|
104 |
+
return len(self.vocab)
|
105 |
+
|
106 |
+
def get_vocab(self):
|
107 |
+
return dict(self.vocab, **self.added_tokens_encoder)
|
108 |
+
|
109 |
+
def _tokenize(self, text):
|
110 |
+
split_tokens = []
|
111 |
+
if self.do_basic_tokenize:
|
112 |
+
for token in self.basic_tokenizer.tokenize(text, never_split=self.all_special_tokens):
|
113 |
+
|
114 |
+
# If the token is part of the never_split set
|
115 |
+
if token in self.basic_tokenizer.never_split:
|
116 |
+
split_tokens.append(token)
|
117 |
+
else:
|
118 |
+
split_tokens += self.wordpiece_tokenizer.tokenize(token)
|
119 |
+
else:
|
120 |
+
split_tokens = self.wordpiece_tokenizer.tokenize(text)
|
121 |
+
return split_tokens
|
122 |
+
|
123 |
+
def _convert_token_to_id(self, token):
|
124 |
+
"""Converts a token (str) in an id using the vocab."""
|
125 |
+
return self.vocab.get(token, self.vocab.get(self.unk_token))
|
126 |
+
|
127 |
+
def _convert_id_to_token(self, index):
|
128 |
+
"""Converts an index (integer) in a token (str) using the vocab."""
|
129 |
+
return self.ids_to_tokens.get(index, self.unk_token)
|
130 |
+
|
131 |
+
def convert_tokens_to_string(self, tokens):
|
132 |
+
"""Converts a sequence of tokens (string) in a single string."""
|
133 |
+
out_string = " ".join(tokens).replace(" ##", "").strip()
|
134 |
+
return out_string
|
135 |
+
|
136 |
+
def build_inputs_with_special_tokens(
|
137 |
+
self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None
|
138 |
+
) -> List[int]:
|
139 |
+
"""
|
140 |
+
Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
|
141 |
+
adding special tokens. A BERT sequence has the following format:
|
142 |
+
|
143 |
+
- single sequence: `[CLS] X [SEP]`
|
144 |
+
- pair of sequences: `[CLS] A [SEP] B [SEP]`
|
145 |
+
|
146 |
+
Args:
|
147 |
+
token_ids_0 (`List[int]`):
|
148 |
+
List of IDs to which the special tokens will be added.
|
149 |
+
token_ids_1 (`List[int]`, *optional*):
|
150 |
+
Optional second list of IDs for sequence pairs.
|
151 |
+
|
152 |
+
Returns:
|
153 |
+
`List[int]`: List of [input IDs](../glossary#input-ids) with the appropriate special tokens.
|
154 |
+
"""
|
155 |
+
sep = [49407]
|
156 |
+
cls = [49406]
|
157 |
+
|
158 |
+
if token_ids_1 is None:
|
159 |
+
return cls + token_ids_0 + sep
|
160 |
+
# return [self.cls_token_id] + token_ids_0 + [self.sep_token_id]
|
161 |
+
# cls = [self.cls_token_id]
|
162 |
+
# sep = [self.sep_token_id]
|
163 |
+
|
164 |
+
return cls + token_ids_0 + sep + token_ids_1 + sep
|
165 |
+
|
166 |
+
def get_special_tokens_mask(
|
167 |
+
self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None,
|
168 |
+
already_has_special_tokens: bool = False
|
169 |
+
) -> List[int]:
|
170 |
+
"""
|
171 |
+
Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
|
172 |
+
special tokens using the tokenizer `prepare_for_model` method.
|
173 |
+
|
174 |
+
Args:
|
175 |
+
token_ids_0 (`List[int]`):
|
176 |
+
List of IDs.
|
177 |
+
token_ids_1 (`List[int]`, *optional*):
|
178 |
+
Optional second list of IDs for sequence pairs.
|
179 |
+
already_has_special_tokens (`bool`, *optional*, defaults to `False`):
|
180 |
+
Whether or not the token list is already formatted with special tokens for the model.
|
181 |
+
|
182 |
+
Returns:
|
183 |
+
`List[int]`: A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
|
184 |
+
"""
|
185 |
+
|
186 |
+
if already_has_special_tokens:
|
187 |
+
return super().get_special_tokens_mask(
|
188 |
+
token_ids_0=token_ids_0, token_ids_1=token_ids_1, already_has_special_tokens=True
|
189 |
+
)
|
190 |
+
|
191 |
+
if token_ids_1 is not None:
|
192 |
+
return [1] + ([0] * len(token_ids_0)) + [1] + ([0] * len(token_ids_1)) + [1]
|
193 |
+
return [1] + ([0] * len(token_ids_0)) + [1]
|
194 |
+
|
195 |
+
def create_token_type_ids_from_sequences(
|
196 |
+
self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None
|
197 |
+
) -> List[int]:
|
198 |
+
"""
|
199 |
+
Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence
|
200 |
+
pair mask has the following format:
|
201 |
+
|
202 |
+
```
|
203 |
+
0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
|
204 |
+
| first sequence | second sequence |
|
205 |
+
```
|
206 |
+
|
207 |
+
If `token_ids_1` is `None`, this method only returns the first portion of the mask (0s).
|
208 |
+
|
209 |
+
Args:
|
210 |
+
token_ids_0 (`List[int]`):
|
211 |
+
List of IDs.
|
212 |
+
token_ids_1 (`List[int]`, *optional*):
|
213 |
+
Optional second list of IDs for sequence pairs.
|
214 |
+
|
215 |
+
Returns:
|
216 |
+
`List[int]`: List of [token type IDs](../glossary#token-type-ids) according to the given sequence(s).
|
217 |
+
"""
|
218 |
+
# sep = [self.sep_token_id]
|
219 |
+
# cls = [self.cls_token_id]
|
220 |
+
sep = [49407]
|
221 |
+
cls = [49406]
|
222 |
+
if token_ids_1 is None:
|
223 |
+
return len(cls + token_ids_0 + sep) * [0]
|
224 |
+
return len(cls + token_ids_0 + sep) * [0] + len(token_ids_1 + sep) * [1]
|
225 |
+
|
226 |
+
def save_vocabulary(self, save_directory: str, filename_prefix: Optional[str] = None) -> Tuple[str]:
|
227 |
+
index = 0
|
228 |
+
if os.path.isdir(save_directory):
|
229 |
+
vocab_file = os.path.join(
|
230 |
+
save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
|
231 |
+
)
|
232 |
+
else:
|
233 |
+
vocab_file = (filename_prefix + "-" if filename_prefix else "") + save_directory
|
234 |
+
with open(vocab_file, "w", encoding="utf-8") as writer:
|
235 |
+
for token, token_index in sorted(self.vocab.items(), key=lambda kv: kv[1]):
|
236 |
+
if index != token_index:
|
237 |
+
logger.warning(
|
238 |
+
f"Saving vocabulary to {vocab_file}: vocabulary indices are not consecutive."
|
239 |
+
" Please check that the vocabulary is not corrupted!"
|
240 |
+
)
|
241 |
+
index = token_index
|
242 |
+
writer.write(token + "\n")
|
243 |
+
index += 1
|
244 |
+
return (vocab_file,)
|
245 |
+
|
246 |
+
|
miaobi_beta0.9/tokenizer/special_tokens_map.json
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": {
|
3 |
+
"content": "[CLS]",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"mask_token": {
|
10 |
+
"content": "[MASK]",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "[PAD]",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"sep_token": {
|
24 |
+
"content": "[SEP]",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
},
|
30 |
+
"unk_token": {
|
31 |
+
"content": "[UNK]",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false
|
36 |
+
}
|
37 |
+
}
|
miaobi_beta0.9/tokenizer/tokenizer_config.json
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "[PAD]",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"100": {
|
12 |
+
"content": "[UNK]",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"101": {
|
20 |
+
"content": "[CLS]",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"102": {
|
28 |
+
"content": "[SEP]",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"103": {
|
36 |
+
"content": "[MASK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"auto_map": {
|
45 |
+
"AutoTokenizer": [
|
46 |
+
"clip_tokenizer_roberta.CLIPTokenizerRoberta",
|
47 |
+
null
|
48 |
+
]
|
49 |
+
},
|
50 |
+
"clean_up_tokenization_spaces": true,
|
51 |
+
"cls_token": "[CLS]",
|
52 |
+
"do_basic_tokenize": true,
|
53 |
+
"do_lower_case": true,
|
54 |
+
"mask_token": "[MASK]",
|
55 |
+
"model_max_length": 77,
|
56 |
+
"never_split": null,
|
57 |
+
"pad_token": "[PAD]",
|
58 |
+
"sep_token": "[SEP]",
|
59 |
+
"strip_accents": null,
|
60 |
+
"tokenize_chinese_chars": true,
|
61 |
+
"tokenizer_class": "CLIPTokenizerRoberta",
|
62 |
+
"unk_token": "[UNK]",
|
63 |
+
"use_fast": true
|
64 |
+
}
|
miaobi_beta0.9/tokenizer/vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
miaobi_beta0.9/unet/config.json
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "UNet2DConditionModel",
|
3 |
+
"_diffusers_version": "0.26.3",
|
4 |
+
"_name_or_path": "C:/Users/user/Desktop/fsdownload/miaobi/one",
|
5 |
+
"act_fn": "silu",
|
6 |
+
"addition_embed_type": null,
|
7 |
+
"addition_embed_type_num_heads": 64,
|
8 |
+
"addition_time_embed_dim": null,
|
9 |
+
"attention_head_dim": 8,
|
10 |
+
"attention_type": "default",
|
11 |
+
"block_out_channels": [
|
12 |
+
320,
|
13 |
+
640,
|
14 |
+
1280,
|
15 |
+
1280
|
16 |
+
],
|
17 |
+
"center_input_sample": false,
|
18 |
+
"class_embed_type": null,
|
19 |
+
"class_embeddings_concat": false,
|
20 |
+
"conv_in_kernel": 3,
|
21 |
+
"conv_out_kernel": 3,
|
22 |
+
"cross_attention_dim": 768,
|
23 |
+
"cross_attention_norm": null,
|
24 |
+
"decay": 0.9999,
|
25 |
+
"down_block_types": [
|
26 |
+
"CrossAttnDownBlock2D",
|
27 |
+
"CrossAttnDownBlock2D",
|
28 |
+
"CrossAttnDownBlock2D",
|
29 |
+
"DownBlock2D"
|
30 |
+
],
|
31 |
+
"downsample_padding": 1,
|
32 |
+
"dropout": 0.0,
|
33 |
+
"dual_cross_attention": false,
|
34 |
+
"encoder_hid_dim": null,
|
35 |
+
"encoder_hid_dim_type": null,
|
36 |
+
"flip_sin_to_cos": true,
|
37 |
+
"freq_shift": 0,
|
38 |
+
"in_channels": 4,
|
39 |
+
"inv_gamma": 1.0,
|
40 |
+
"layers_per_block": 2,
|
41 |
+
"mid_block_only_cross_attention": null,
|
42 |
+
"mid_block_scale_factor": 1,
|
43 |
+
"mid_block_type": "UNetMidBlock2DCrossAttn",
|
44 |
+
"min_decay": 0.0,
|
45 |
+
"norm_eps": 1e-05,
|
46 |
+
"norm_num_groups": 32,
|
47 |
+
"num_attention_heads": null,
|
48 |
+
"num_class_embeds": null,
|
49 |
+
"only_cross_attention": false,
|
50 |
+
"optimization_step": 20000,
|
51 |
+
"out_channels": 4,
|
52 |
+
"power": 0.6666666666666666,
|
53 |
+
"projection_class_embeddings_input_dim": null,
|
54 |
+
"resnet_out_scale_factor": 1.0,
|
55 |
+
"resnet_skip_time_act": false,
|
56 |
+
"resnet_time_scale_shift": "default",
|
57 |
+
"reverse_transformer_layers_per_block": null,
|
58 |
+
"sample_size": 64,
|
59 |
+
"time_cond_proj_dim": null,
|
60 |
+
"time_embedding_act_fn": null,
|
61 |
+
"time_embedding_dim": null,
|
62 |
+
"time_embedding_type": "positional",
|
63 |
+
"timestep_post_act": null,
|
64 |
+
"transformer_layers_per_block": 1,
|
65 |
+
"up_block_types": [
|
66 |
+
"UpBlock2D",
|
67 |
+
"CrossAttnUpBlock2D",
|
68 |
+
"CrossAttnUpBlock2D",
|
69 |
+
"CrossAttnUpBlock2D"
|
70 |
+
],
|
71 |
+
"upcast_attention": false,
|
72 |
+
"update_after_step": 0,
|
73 |
+
"use_ema_warmup": false,
|
74 |
+
"use_linear_projection": false
|
75 |
+
}
|
miaobi_beta0.9/unet/diffusion_pytorch_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6a00e3f5b9becc70cee4351f3a5fab6411e15f7dc7e4e67c63cae45623bbaf3c
|
3 |
+
size 1719125304
|
miaobi_beta0.9/vae/config.json
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "AutoencoderKL",
|
3 |
+
"_diffusers_version": "0.26.3",
|
4 |
+
"_name_or_path": "stabilityai/sd-vae-ft-mse",
|
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 |
+
"layers_per_block": 2,
|
22 |
+
"norm_num_groups": 32,
|
23 |
+
"out_channels": 3,
|
24 |
+
"sample_size": 256,
|
25 |
+
"scaling_factor": 0.18215,
|
26 |
+
"up_block_types": [
|
27 |
+
"UpDecoderBlock2D",
|
28 |
+
"UpDecoderBlock2D",
|
29 |
+
"UpDecoderBlock2D",
|
30 |
+
"UpDecoderBlock2D"
|
31 |
+
]
|
32 |
+
}
|
miaobi_beta0.9/vae/diffusion_pytorch_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3e4c08995484ee61270175e9e7a072b66a6e4eeb5f0c266667fe1f45b90daf9a
|
3 |
+
size 167335342
|