Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +6 -0
- chat_template.jinja +110 -0
- config.json +10 -0
- processor_config.json +63 -0
- pytorch_model.bin +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +29 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
# Qwen3-VL JEPA World Model
|
| 3 |
+
Base Model: Qwen/Qwen3-VL-4B-Thinking
|
| 4 |
+
Latent Space: Stable Diffusion 1.5 VAE
|
| 5 |
+
|
| 6 |
+
This model predicts the next latent state of a scene using Qwen3's thinking architecture.
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 %}
|
| 33 |
+
{{- "\n" }}
|
| 34 |
+
{{- tool | tojson }}
|
| 35 |
+
{%- endfor %}
|
| 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" %}
|
| 58 |
+
{%- set reasoning_content = '' %}
|
| 59 |
+
{%- if message.reasoning_content is string %}
|
| 60 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 61 |
+
{%- else %}
|
| 62 |
+
{%- if '</think>' in content %}
|
| 63 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 64 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 65 |
+
{%- endif %}
|
| 66 |
+
{%- endif %}
|
| 67 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 68 |
+
{%- if loop.last or (not loop.last and reasoning_content) %}
|
| 69 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
| 70 |
+
{%- else %}
|
| 71 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 72 |
+
{%- endif %}
|
| 73 |
+
{%- else %}
|
| 74 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 75 |
+
{%- endif %}
|
| 76 |
+
{%- if message.tool_calls %}
|
| 77 |
+
{%- for tool_call in message.tool_calls %}
|
| 78 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 79 |
+
{{- '\n' }}
|
| 80 |
+
{%- endif %}
|
| 81 |
+
{%- if tool_call.function %}
|
| 82 |
+
{%- set tool_call = tool_call.function %}
|
| 83 |
+
{%- endif %}
|
| 84 |
+
{{- '<tool_call>\n{"name": "' }}
|
| 85 |
+
{{- tool_call.name }}
|
| 86 |
+
{{- '", "arguments": ' }}
|
| 87 |
+
{%- if tool_call.arguments is string %}
|
| 88 |
+
{{- tool_call.arguments }}
|
| 89 |
+
{%- else %}
|
| 90 |
+
{{- tool_call.arguments | tojson }}
|
| 91 |
+
{%- endif %}
|
| 92 |
+
{{- '}\n</tool_call>' }}
|
| 93 |
+
{%- endfor %}
|
| 94 |
+
{%- endif %}
|
| 95 |
+
{{- '<|im_end|>\n' }}
|
| 96 |
+
{%- elif message.role == "tool" %}
|
| 97 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 98 |
+
{{- '<|im_start|>user' }}
|
| 99 |
+
{%- endif %}
|
| 100 |
+
{{- '\n<tool_response>\n' }}
|
| 101 |
+
{{- content }}
|
| 102 |
+
{{- '\n</tool_response>' }}
|
| 103 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 104 |
+
{{- '<|im_end|>\n' }}
|
| 105 |
+
{%- endif %}
|
| 106 |
+
{%- endif %}
|
| 107 |
+
{%- endfor %}
|
| 108 |
+
{%- if add_generation_prompt %}
|
| 109 |
+
{{- '<|im_start|>assistant\n<think>\n' }}
|
| 110 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3VLSuperWorldModel"
|
| 4 |
+
],
|
| 5 |
+
"model_type": "multimodal_jepa_world",
|
| 6 |
+
"base_llm": "Qwen/Qwen3-VL-4B-Thinking",
|
| 7 |
+
"visual_vae": "runwayml/stable-diffusion-v1-5",
|
| 8 |
+
"hidden_size": 2560,
|
| 9 |
+
"latent_channels": 4
|
| 10 |
+
}
|
processor_config.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"data_format": "channels_first",
|
| 4 |
+
"do_convert_rgb": true,
|
| 5 |
+
"do_normalize": true,
|
| 6 |
+
"do_rescale": true,
|
| 7 |
+
"do_resize": true,
|
| 8 |
+
"image_mean": [
|
| 9 |
+
0.5,
|
| 10 |
+
0.5,
|
| 11 |
+
0.5
|
| 12 |
+
],
|
| 13 |
+
"image_processor_type": "Qwen2VLImageProcessorFast",
|
| 14 |
+
"image_std": [
|
| 15 |
+
0.5,
|
| 16 |
+
0.5,
|
| 17 |
+
0.5
|
| 18 |
+
],
|
| 19 |
+
"merge_size": 2,
|
| 20 |
+
"patch_size": 16,
|
| 21 |
+
"resample": 3,
|
| 22 |
+
"rescale_factor": 0.00392156862745098,
|
| 23 |
+
"size": {
|
| 24 |
+
"longest_edge": 16777216,
|
| 25 |
+
"shortest_edge": 65536
|
| 26 |
+
},
|
| 27 |
+
"temporal_patch_size": 2
|
| 28 |
+
},
|
| 29 |
+
"processor_class": "Qwen3VLProcessor",
|
| 30 |
+
"video_processor": {
|
| 31 |
+
"data_format": "channels_first",
|
| 32 |
+
"default_to_square": true,
|
| 33 |
+
"do_convert_rgb": true,
|
| 34 |
+
"do_normalize": true,
|
| 35 |
+
"do_rescale": true,
|
| 36 |
+
"do_resize": true,
|
| 37 |
+
"do_sample_frames": true,
|
| 38 |
+
"fps": 2,
|
| 39 |
+
"image_mean": [
|
| 40 |
+
0.5,
|
| 41 |
+
0.5,
|
| 42 |
+
0.5
|
| 43 |
+
],
|
| 44 |
+
"image_std": [
|
| 45 |
+
0.5,
|
| 46 |
+
0.5,
|
| 47 |
+
0.5
|
| 48 |
+
],
|
| 49 |
+
"max_frames": 768,
|
| 50 |
+
"merge_size": 2,
|
| 51 |
+
"min_frames": 4,
|
| 52 |
+
"patch_size": 16,
|
| 53 |
+
"resample": 3,
|
| 54 |
+
"rescale_factor": 0.00392156862745098,
|
| 55 |
+
"return_metadata": false,
|
| 56 |
+
"size": {
|
| 57 |
+
"longest_edge": 25165824,
|
| 58 |
+
"shortest_edge": 4096
|
| 59 |
+
},
|
| 60 |
+
"temporal_patch_size": 2,
|
| 61 |
+
"video_processor_type": "Qwen3VLVideoProcessor"
|
| 62 |
+
}
|
| 63 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b07ddc19ed4c9c529e543aa547d887459a802dd1fd0f000d8b206e879f8405e2
|
| 3 |
+
size 276203991
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
|
| 3 |
+
size 11422650
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"<|im_start|>",
|
| 10 |
+
"<|im_end|>",
|
| 11 |
+
"<|object_ref_start|>",
|
| 12 |
+
"<|object_ref_end|>",
|
| 13 |
+
"<|box_start|>",
|
| 14 |
+
"<|box_end|>",
|
| 15 |
+
"<|quad_start|>",
|
| 16 |
+
"<|quad_end|>",
|
| 17 |
+
"<|vision_start|>",
|
| 18 |
+
"<|vision_end|>",
|
| 19 |
+
"<|vision_pad|>",
|
| 20 |
+
"<|image_pad|>",
|
| 21 |
+
"<|video_pad|>"
|
| 22 |
+
],
|
| 23 |
+
"is_local": false,
|
| 24 |
+
"model_max_length": 262144,
|
| 25 |
+
"pad_token": "<|endoftext|>",
|
| 26 |
+
"split_special_tokens": false,
|
| 27 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 28 |
+
"unk_token": null
|
| 29 |
+
}
|