2601
Browse files- samples/unet_192x320_0.jpg +2 -2
- samples/unet_256x320_0.jpg +2 -2
- samples/unet_320x192_0.jpg +2 -2
- samples/unet_320x256_0.jpg +2 -2
- samples/unet_320x320_0.jpg +2 -2
- src/sd15_2048.ipynb +2 -2
- test.ipynb +2 -2
- text_encoder/config.json +2 -2
- text_encoder/generation_config.json +3 -0
- text_encoder/model.safetensors +2 -2
- tokenizer/chat_template.jinja +36 -15
- tokenizer/tokenizer_config.json +1 -1
- train.py +1 -1
- unet/config.json +1 -1
- unet/diffusion_pytorch_model.safetensors +2 -2
- unet_sd15/config.json +3 -0
- unet_sd15/diffusion_pytorch_model.safetensors +3 -0
samples/unet_192x320_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_256x320_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_320x192_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_320x256_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
samples/unet_320x320_0.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
src/sd15_2048.ipynb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0e269bc293298ebb305b766c45576fc19bf7f5cbba3891f86fe0eb098941a6d9
|
| 3 |
+
size 64886
|
test.ipynb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:58a27239863602451840062946b9930543b8b59bc0a7abaa59e613df0d216f2f
|
| 3 |
+
size 5214545
|
text_encoder/config.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:84c37ee8025b892ca9210635a38228f4650373ad5e59628af66d344f967ce64e
|
| 3 |
+
size 1360
|
text_encoder/generation_config.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8b9afb365eaab1c8fc2395f618067ee2307b9821e207f12c5c52cf371a14b0e0
|
| 3 |
+
size 121
|
text_encoder/model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08a190beb6e66815d00f15994ca740b1cbe78ee6f5b0c4d682855c9219451a5a
|
| 3 |
+
size 3441185296
|
tokenizer/chat_template.jinja
CHANGED
|
@@ -1,7 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
{%- if tools %}
|
| 2 |
{{- '<|im_start|>system\n' }}
|
| 3 |
{%- if messages[0].role == 'system' %}
|
| 4 |
-
{{- messages[0].content + '\n\n' }}
|
| 5 |
{%- endif %}
|
| 6 |
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 7 |
{%- for tool in tools %}
|
|
@@ -11,23 +36,22 @@
|
|
| 11 |
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 12 |
{%- else %}
|
| 13 |
{%- if messages[0].role == 'system' %}
|
| 14 |
-
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
{%- endif %}
|
| 16 |
{%- endif %}
|
| 17 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
{%- for message in messages[::-1] %}
|
| 19 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
-
{%- if ns.multi_step_tool and message.role == "user"
|
| 21 |
-
{%- set
|
| 22 |
-
{%-
|
|
|
|
|
|
|
|
|
|
| 23 |
{%- endif %}
|
| 24 |
{%- endfor %}
|
| 25 |
{%- for message in messages %}
|
| 26 |
-
{%-
|
| 27 |
-
{%- set content = message.content %}
|
| 28 |
-
{%- else %}
|
| 29 |
-
{%- set content = '' %}
|
| 30 |
-
{%- endif %}
|
| 31 |
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 32 |
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 33 |
{%- elif message.role == "assistant" %}
|
|
@@ -82,8 +106,5 @@
|
|
| 82 |
{%- endif %}
|
| 83 |
{%- endfor %}
|
| 84 |
{%- if add_generation_prompt %}
|
| 85 |
-
{{- '<|im_start|>assistant\n' }}
|
| 86 |
-
|
| 87 |
-
{{- '<think>\n\n</think>\n\n' }}
|
| 88 |
-
{%- endif %}
|
| 89 |
-
{%- endif %}
|
|
|
|
| 1 |
+
{%- set image_count = namespace(value=0) %}
|
| 2 |
+
{%- set video_count = namespace(value=0) %}
|
| 3 |
+
{%- macro render_content(content, do_vision_count) %}
|
| 4 |
+
{%- if content is string %}
|
| 5 |
+
{{- content }}
|
| 6 |
+
{%- else %}
|
| 7 |
+
{%- for item in content %}
|
| 8 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 9 |
+
{%- if do_vision_count %}
|
| 10 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 11 |
+
{%- endif %}
|
| 12 |
+
{%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}
|
| 13 |
+
<|vision_start|><|image_pad|><|vision_end|>
|
| 14 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 15 |
+
{%- if do_vision_count %}
|
| 16 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}
|
| 19 |
+
<|vision_start|><|video_pad|><|vision_end|>
|
| 20 |
+
{%- elif 'text' in item %}
|
| 21 |
+
{{- item.text }}
|
| 22 |
+
{%- endif %}
|
| 23 |
+
{%- endfor %}
|
| 24 |
+
{%- endif %}
|
| 25 |
+
{%- endmacro %}
|
| 26 |
{%- if tools %}
|
| 27 |
{{- '<|im_start|>system\n' }}
|
| 28 |
{%- if messages[0].role == 'system' %}
|
| 29 |
+
{{- render_content(messages[0].content, false) + '\n\n' }}
|
| 30 |
{%- endif %}
|
| 31 |
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 32 |
{%- for tool in tools %}
|
|
|
|
| 36 |
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 37 |
{%- else %}
|
| 38 |
{%- if messages[0].role == 'system' %}
|
| 39 |
+
{{- '<|im_start|>system\n' + render_content(messages[0].content, false) + '<|im_end|>\n' }}
|
| 40 |
{%- endif %}
|
| 41 |
{%- endif %}
|
| 42 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 43 |
{%- for message in messages[::-1] %}
|
| 44 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 45 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 46 |
+
{%- set content = render_content(message.content, false) %}
|
| 47 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 48 |
+
{%- set ns.multi_step_tool = false %}
|
| 49 |
+
{%- set ns.last_query_index = index %}
|
| 50 |
+
{%- endif %}
|
| 51 |
{%- endif %}
|
| 52 |
{%- endfor %}
|
| 53 |
{%- for message in messages %}
|
| 54 |
+
{%- set content = render_content(message.content, True) %}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 56 |
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 57 |
{%- elif message.role == "assistant" %}
|
|
|
|
| 106 |
{%- endif %}
|
| 107 |
{%- endfor %}
|
| 108 |
{%- if add_generation_prompt %}
|
| 109 |
+
{{- '<|im_start|>assistant\n<think>\n' }}
|
| 110 |
+
{%- endif %}
|
|
|
|
|
|
|
|
|
tokenizer/tokenizer_config.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 5404
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:355f2b4e5bad7b01f11ef6cb68ebc176f61b95c3276092ea225b1bea0e01e95c
|
| 3 |
size 5404
|
train.py
CHANGED
|
@@ -29,7 +29,7 @@ from transformers import AutoTokenizer, AutoModel
|
|
| 29 |
# --------------------------- Параметры ---------------------------
|
| 30 |
ds_path = "/workspace/sdxs/datasets/mjnj"
|
| 31 |
project = "unet"
|
| 32 |
-
batch_size =
|
| 33 |
base_learning_rate = 4e-5 #2.7e-5
|
| 34 |
min_learning_rate = 1e-5 #2.7e-5
|
| 35 |
num_epochs = 50
|
|
|
|
| 29 |
# --------------------------- Параметры ---------------------------
|
| 30 |
ds_path = "/workspace/sdxs/datasets/mjnj"
|
| 31 |
project = "unet"
|
| 32 |
+
batch_size = 24
|
| 33 |
base_learning_rate = 4e-5 #2.7e-5
|
| 34 |
min_learning_rate = 1e-5 #2.7e-5
|
| 35 |
num_epochs = 50
|
unet/config.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1813
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:526c074225e5cd6567d513a6fdfbbe27dacfe3580843229bcdcf66f229bfaa7f
|
| 3 |
size 1813
|
unet/diffusion_pytorch_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:63bdfd6ba99237a331a64b494babcf5a1b463cad93178328e7e112f3c10488f3
|
| 3 |
+
size 4663712768
|
unet_sd15/config.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:78d4828222ad3a8cddeadf895d9a3afce5c95869d374458dc2c7e5d3b9bf9864
|
| 3 |
+
size 1813
|
unet_sd15/diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:117b50c39c48aab6471ffee83429331794f90b825bacda4488a2a4aa7ed2ffa8
|
| 3 |
+
size 3566239360
|