aditya11997
commited on
Commit
•
b0371f0
1
Parent(s):
4ea42b7
End of training
Browse files- README.md +50 -0
- image_encoder/config.json +23 -0
- image_encoder/model.safetensors +3 -0
- image_processor/preprocessor_config.json +27 -0
- logs/text2image-fine-tune/1709712401.761387/events.out.tfevents.1709712401.777f50584738.1857.1 +3 -0
- logs/text2image-fine-tune/1709712401.7630112/hparams.yml +41 -0
- logs/text2image-fine-tune/events.out.tfevents.1709712401.777f50584738.1857.0 +3 -0
- model_index.json +28 -0
- prior/config.json +20 -0
- prior/diffusion_pytorch_model.safetensors +3 -0
- scheduler/scheduler_config.json +10 -0
- text_encoder/config.json +25 -0
- text_encoder/model.safetensors +3 -0
- tokenizer/merges.txt +0 -0
- tokenizer/special_tokens_map.json +24 -0
- tokenizer/tokenizer_config.json +30 -0
- tokenizer/vocab.json +0 -0
- val_imgs_grid.png +0 -0
README.md
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
license: creativeml-openrail-m
|
4 |
+
base_model: kandinsky-community/kandinsky-2-2-prior
|
5 |
+
datasets:
|
6 |
+
- kbharat7/DogChestXrayDatasetNew
|
7 |
+
tags:
|
8 |
+
- kandinsky
|
9 |
+
- text-to-image
|
10 |
+
- diffusers
|
11 |
+
- diffusers-training
|
12 |
+
inference: true
|
13 |
+
---
|
14 |
+
|
15 |
+
# Finetuning - aditya11997/test_prior
|
16 |
+
|
17 |
+
This pipeline was finetuned from **kandinsky-community/kandinsky-2-2-prior** on the **kbharat7/DogChestXrayDatasetNew** dataset. Below are some example images generated with the finetuned pipeline using the following prompts: ['dogxraysmall']:
|
18 |
+
|
19 |
+
![val_imgs_grid](./val_imgs_grid.png)
|
20 |
+
|
21 |
+
|
22 |
+
## Pipeline usage
|
23 |
+
|
24 |
+
You can use the pipeline like so:
|
25 |
+
|
26 |
+
```python
|
27 |
+
from diffusers import DiffusionPipeline
|
28 |
+
import torch
|
29 |
+
|
30 |
+
pipe_prior = DiffusionPipeline.from_pretrained("aditya11997/test_prior", torch_dtype=torch.float16)
|
31 |
+
pipe_t2i = DiffusionPipeline.from_pretrained("kandinsky-community/kandinsky-2-2-decoder", torch_dtype=torch.float16)
|
32 |
+
prompt = "dogxraysmall"
|
33 |
+
image_embeds, negative_image_embeds = pipe_prior(prompt, guidance_scale=1.0).to_tuple()
|
34 |
+
image = pipe_t2i(image_embeds=image_embeds, negative_image_embeds=negative_image_embeds).images[0]
|
35 |
+
image.save("my_image.png")
|
36 |
+
```
|
37 |
+
|
38 |
+
## Training info
|
39 |
+
|
40 |
+
These are the key hyperparameters used during training:
|
41 |
+
|
42 |
+
* Epochs: 1
|
43 |
+
* Learning rate: 1e-05
|
44 |
+
* Batch size: 1
|
45 |
+
* Gradient accumulation steps: 4
|
46 |
+
* Image resolution: 768
|
47 |
+
* Mixed-precision: None
|
48 |
+
|
49 |
+
|
50 |
+
More information on all the CLI arguments and the environment are available on your [`wandb` run page](https://wandb.ai/aditya11997/text2image-fine-tune/runs/9j7m0fr8).
|
image_encoder/config.json
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "kandinsky-community/kandinsky-2-2-prior",
|
3 |
+
"architectures": [
|
4 |
+
"CLIPVisionModelWithProjection"
|
5 |
+
],
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"dropout": 0.0,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_size": 1664,
|
10 |
+
"image_size": 224,
|
11 |
+
"initializer_factor": 1.0,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 8192,
|
14 |
+
"layer_norm_eps": 1e-05,
|
15 |
+
"model_type": "clip_vision_model",
|
16 |
+
"num_attention_heads": 16,
|
17 |
+
"num_channels": 3,
|
18 |
+
"num_hidden_layers": 48,
|
19 |
+
"patch_size": 14,
|
20 |
+
"projection_dim": 1280,
|
21 |
+
"torch_dtype": "float16",
|
22 |
+
"transformers_version": "4.38.2"
|
23 |
+
}
|
image_encoder/model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dabf125eaf7f339da6b900a7a14f8190f02913b7d46cab80e09cd0755c4ce39c
|
3 |
+
size 3689910512
|
image_processor/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 |
+
}
|
logs/text2image-fine-tune/1709712401.761387/events.out.tfevents.1709712401.777f50584738.1857.1
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:38b63accc930690c735540783e5103df541e0de660ea49ac001e2afde5b57fc1
|
3 |
+
size 2030
|
logs/text2image-fine-tune/1709712401.7630112/hparams.yml
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
adam_beta1: 0.9
|
2 |
+
adam_beta2: 0.999
|
3 |
+
adam_epsilon: 1.0e-08
|
4 |
+
adam_weight_decay: 0.0
|
5 |
+
allow_tf32: false
|
6 |
+
cache_dir: null
|
7 |
+
caption_column: text
|
8 |
+
checkpointing_steps: 500
|
9 |
+
checkpoints_total_limit: 3
|
10 |
+
dataloader_num_workers: 0
|
11 |
+
dataset_config_name: null
|
12 |
+
dataset_name: kbharat7/DogChestXrayDatasetNew
|
13 |
+
gradient_accumulation_steps: 4
|
14 |
+
hub_model_id: null
|
15 |
+
hub_token: null
|
16 |
+
image_column: image
|
17 |
+
learning_rate: 1.0e-05
|
18 |
+
local_rank: -1
|
19 |
+
logging_dir: logs
|
20 |
+
lr_scheduler: constant
|
21 |
+
lr_warmup_steps: 500
|
22 |
+
max_grad_norm: 1.0
|
23 |
+
max_train_samples: null
|
24 |
+
max_train_steps: 10
|
25 |
+
mixed_precision: null
|
26 |
+
num_train_epochs: 1
|
27 |
+
output_dir: test_prior
|
28 |
+
pretrained_decoder_model_name_or_path: kandinsky-community/kandinsky-2-2-decoder
|
29 |
+
pretrained_prior_model_name_or_path: kandinsky-community/kandinsky-2-2-prior
|
30 |
+
push_to_hub: true
|
31 |
+
report_to: tensorboard
|
32 |
+
resolution: 768
|
33 |
+
resume_from_checkpoint: null
|
34 |
+
seed: null
|
35 |
+
snr_gamma: null
|
36 |
+
tracker_project_name: text2image-fine-tune
|
37 |
+
train_batch_size: 1
|
38 |
+
train_data_dir: null
|
39 |
+
use_8bit_adam: false
|
40 |
+
use_ema: false
|
41 |
+
validation_epochs: 5
|
logs/text2image-fine-tune/events.out.tfevents.1709712401.777f50584738.1857.0
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:042af7d775f34c27d5f6d7317b9cdf0344267555aa973722f59a1c78f6bbb81f
|
3 |
+
size 336100
|
model_index.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "KandinskyV22PriorPipeline",
|
3 |
+
"_diffusers_version": "0.27.0.dev0",
|
4 |
+
"image_encoder": [
|
5 |
+
"transformers",
|
6 |
+
"CLIPVisionModelWithProjection"
|
7 |
+
],
|
8 |
+
"image_processor": [
|
9 |
+
"transformers",
|
10 |
+
"CLIPImageProcessor"
|
11 |
+
],
|
12 |
+
"prior": [
|
13 |
+
"diffusers",
|
14 |
+
"PriorTransformer"
|
15 |
+
],
|
16 |
+
"scheduler": [
|
17 |
+
"diffusers",
|
18 |
+
"UnCLIPScheduler"
|
19 |
+
],
|
20 |
+
"text_encoder": [
|
21 |
+
"transformers",
|
22 |
+
"CLIPTextModelWithProjection"
|
23 |
+
],
|
24 |
+
"tokenizer": [
|
25 |
+
"transformers",
|
26 |
+
"CLIPTokenizer"
|
27 |
+
]
|
28 |
+
}
|
prior/config.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "PriorTransformer",
|
3 |
+
"_diffusers_version": "0.27.0.dev0",
|
4 |
+
"_name_or_path": "kandinsky-community/kandinsky-2-2-prior",
|
5 |
+
"added_emb_type": "prd",
|
6 |
+
"additional_embeddings": 4,
|
7 |
+
"attention_head_dim": 64,
|
8 |
+
"clip_embed_dim": null,
|
9 |
+
"dropout": 0.0,
|
10 |
+
"embedding_dim": 1280,
|
11 |
+
"embedding_proj_dim": null,
|
12 |
+
"embedding_proj_norm_type": null,
|
13 |
+
"encoder_hid_proj_type": "linear",
|
14 |
+
"norm_in_type": null,
|
15 |
+
"num_attention_heads": 32,
|
16 |
+
"num_embeddings": 77,
|
17 |
+
"num_layers": 20,
|
18 |
+
"time_embed_act_fn": "silu",
|
19 |
+
"time_embed_dim": null
|
20 |
+
}
|
prior/diffusion_pytorch_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:28007025d5506a871d345ef898846d449ad6528cfd95e98f00ed87efa06d63b5
|
3 |
+
size 4104940968
|
scheduler/scheduler_config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "UnCLIPScheduler",
|
3 |
+
"_diffusers_version": "0.27.0.dev0",
|
4 |
+
"beta_schedule": "squaredcos_cap_v2",
|
5 |
+
"clip_sample": true,
|
6 |
+
"clip_sample_range": 10.0,
|
7 |
+
"num_train_timesteps": 1000,
|
8 |
+
"prediction_type": "sample",
|
9 |
+
"variance_type": "fixed_small_log"
|
10 |
+
}
|
text_encoder/config.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "kandinsky-community/kandinsky-2-2-prior",
|
3 |
+
"architectures": [
|
4 |
+
"CLIPTextModelWithProjection"
|
5 |
+
],
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"dropout": 0.0,
|
9 |
+
"eos_token_id": 2,
|
10 |
+
"hidden_act": "gelu",
|
11 |
+
"hidden_size": 1280,
|
12 |
+
"initializer_factor": 1.0,
|
13 |
+
"initializer_range": 0.02,
|
14 |
+
"intermediate_size": 5120,
|
15 |
+
"layer_norm_eps": 1e-05,
|
16 |
+
"max_position_embeddings": 77,
|
17 |
+
"model_type": "clip_text_model",
|
18 |
+
"num_attention_heads": 20,
|
19 |
+
"num_hidden_layers": 32,
|
20 |
+
"pad_token_id": 1,
|
21 |
+
"projection_dim": 1280,
|
22 |
+
"torch_dtype": "float16",
|
23 |
+
"transformers_version": "4.38.2",
|
24 |
+
"vocab_size": 49408
|
25 |
+
}
|
text_encoder/model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ec310df2af79c318e24d20511b601a591ca8cd4f1fce1d8dff822a356bcdb1f4
|
3 |
+
size 1389382176
|
tokenizer/merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer/special_tokens_map.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<|startoftext|>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": true,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "<|endoftext|>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": true,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": "<|endoftext|>",
|
17 |
+
"unk_token": {
|
18 |
+
"content": "<|endoftext|>",
|
19 |
+
"lstrip": false,
|
20 |
+
"normalized": true,
|
21 |
+
"rstrip": false,
|
22 |
+
"single_word": false
|
23 |
+
}
|
24 |
+
}
|
tokenizer/tokenizer_config.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": false,
|
3 |
+
"added_tokens_decoder": {
|
4 |
+
"49406": {
|
5 |
+
"content": "<|startoftext|>",
|
6 |
+
"lstrip": false,
|
7 |
+
"normalized": true,
|
8 |
+
"rstrip": false,
|
9 |
+
"single_word": false,
|
10 |
+
"special": true
|
11 |
+
},
|
12 |
+
"49407": {
|
13 |
+
"content": "<|endoftext|>",
|
14 |
+
"lstrip": false,
|
15 |
+
"normalized": true,
|
16 |
+
"rstrip": false,
|
17 |
+
"single_word": false,
|
18 |
+
"special": true
|
19 |
+
}
|
20 |
+
},
|
21 |
+
"bos_token": "<|startoftext|>",
|
22 |
+
"clean_up_tokenization_spaces": true,
|
23 |
+
"do_lower_case": true,
|
24 |
+
"eos_token": "<|endoftext|>",
|
25 |
+
"errors": "replace",
|
26 |
+
"model_max_length": 77,
|
27 |
+
"pad_token": "<|endoftext|>",
|
28 |
+
"tokenizer_class": "CLIPTokenizer",
|
29 |
+
"unk_token": "<|endoftext|>"
|
30 |
+
}
|
tokenizer/vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
val_imgs_grid.png
ADDED