diff --git a/.gitattributes b/.gitattributes index 3b5643610b7d5065059d8469944be8fb0cd3b795..b54e2b957c58d58d2bc43f485b345ead4ea9d55a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -94,3 +94,9 @@ ckpts/S2/4b/qwen3_5_2b/v13_6/v0-20260820-192228/checkpoint-1400/tokenizer.json f ckpts/S2/4b/qwen3_5_2b/v14_1_mkl_layer3/v0-20261012-043050/checkpoint-1530/tokenizer.json filter=lfs diff=lfs merge=lfs -text ckpts/S2/4b/qwen3_5_2b/baseline_tmerge_64f_20pct/v0-20261012-171609/checkpoint-1530/tokenizer.json filter=lfs diff=lfs merge=lfs -text ckpts/S2/4b/siglip2_large/siglip2_large/v0-20261024-091108/checkpoint-1530/tokenizer.json filter=lfs diff=lfs merge=lfs -text +ckpts/S2/4b/internvl3_5_2b/internvit_baseline/v0-20261017-034032/checkpoint-2206/tokenizer.json filter=lfs diff=lfs merge=lfs -text +ckpts/S2/4b/pe_lang_large/pe_lang_large/v0-20261024-152414/checkpoint-2182/tokenizer.json filter=lfs diff=lfs merge=lfs -text +ckpts/S2/4b/radio_v3_large/radio_v3_large/v0-20261024-142322/checkpoint-1530/tokenizer.json filter=lfs diff=lfs merge=lfs -text +ckpts/S2/4b/siglip2_so400m/siglip2_so400m/v0-20261024-102319/checkpoint-2182/tokenizer.json filter=lfs diff=lfs merge=lfs -text +ckpts/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505/checkpoint-2182/tokenizer.json filter=lfs diff=lfs merge=lfs -text +ckpts/S2/4b/siglip_hd/siglip_hd/v0-20261024-104810/checkpoint-1530/tokenizer.json filter=lfs diff=lfs merge=lfs -text diff --git a/ckpts/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505/checkpoint-2182/args.json b/ckpts/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505/checkpoint-2182/args.json new file mode 100644 index 0000000000000000000000000000000000000000..a9e9fb6583ac0de5bef5fa4caa37c478a1887db7 --- /dev/null +++ b/ckpts/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505/checkpoint-2182/args.json @@ -0,0 +1,393 @@ +{ + "output_dir": "/home/wangjunjie09/VisionEncoder/V3_exps/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505", + "per_device_train_batch_size": 1, + "num_train_epochs": 1.0, + "max_steps": -1, + "learning_rate": 1e-05, + "lr_scheduler_type": "cosine", + "lr_scheduler_kwargs": null, + "warmup_steps": 0, + "optim": "adamw_torch_fused", + "optim_args": null, + "weight_decay": 0.1, + "adam_beta1": 0.9, + "adam_beta2": 0.95, + "adam_epsilon": 1e-08, + "optim_target_modules": null, + "gradient_accumulation_steps": 8, + "average_tokens_across_devices": true, + "max_grad_norm": 1.0, + "label_smoothing_factor": 0.0, + "bf16": true, + "fp16": false, + "bf16_full_eval": false, + "fp16_full_eval": false, + "tf32": null, + "gradient_checkpointing": true, + "gradient_checkpointing_kwargs": "{\"use_reentrant\": false}", + "torch_compile": false, + "torch_compile_backend": null, + "torch_compile_mode": null, + "use_liger_kernel": false, + "liger_kernel_config": null, + "use_cache": false, + "neftune_noise_alpha": null, + "torch_empty_cache_steps": null, + "auto_find_batch_size": false, + "logging_strategy": "steps", + "logging_steps": 5, + "logging_first_step": true, + "log_on_each_node": true, + "logging_nan_inf_filter": true, + "include_num_input_tokens_seen": false, + "log_level": "passive", + "log_level_replica": "warning", + "disable_tqdm": null, + "report_to": [ + "none" + ], + "run_name": "/home/wangjunjie09/exps/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505", + "project": "huggingface", + "trackio_space_id": "trackio", + "eval_strategy": "no", + "eval_steps": 100.0, + "eval_delay": 0, + "per_device_eval_batch_size": 1, + "prediction_loss_only": false, + "eval_on_start": false, + "eval_do_concat_batches": true, + "eval_use_gather_object": false, + "eval_accumulation_steps": null, + "include_for_metrics": [], + "batch_eval_metrics": false, + "save_only_model": false, + "save_strategy": "steps", + "save_steps": 100.0, + "save_on_each_node": false, + "save_total_limit": 1, + "enable_jit_checkpoint": false, + "push_to_hub": false, + "hub_token": null, + "hub_private_repo": null, + "hub_model_id": null, + "hub_strategy": "every_save", + "hub_always_push": false, + "hub_revision": null, + "load_best_model_at_end": false, + "metric_for_best_model": "loss", + "greater_is_better": false, + "ignore_data_skip": false, + "restore_callback_states_from_checkpoint": false, + "full_determinism": false, + "seed": 42, + "data_seed": 42, + "use_cpu": false, + "accelerator_config": "{\"dispatch_batches\": false}", + "parallelism_config": null, + "dataloader_drop_last": false, + "dataloader_num_workers": 8, + "dataloader_pin_memory": true, + "dataloader_persistent_workers": true, + "dataloader_prefetch_factor": 4, + "remove_unused_columns": true, + "label_names": null, + "train_sampling_strategy": "random", + "length_column_name": "length", + "ddp_find_unused_parameters": null, + "ddp_bucket_cap_mb": null, + "ddp_broadcast_buffers": null, + "ddp_backend": null, + "ddp_timeout": 7200, + "fsdp": [], + "fsdp_config": null, + "deepspeed": { + "fp16": { + "enabled": "auto", + "loss_scale": 0, + "loss_scale_window": 1000, + "initial_scale_power": 16, + "hysteresis": 2, + "min_loss_scale": 1 + }, + "bf16": { + "enabled": "auto" + }, + "zero_optimization": { + "stage": 2, + "offload_optimizer": { + "device": "none", + "pin_memory": true + }, + "allgather_partitions": true, + "allgather_bucket_size": 200000000.0, + "overlap_comm": false, + "reduce_scatter": true, + "reduce_bucket_size": 200000000.0, + "contiguous_gradients": true + }, + "gradient_accumulation_steps": "auto", + "gradient_clipping": "auto", + "steps_per_print": 2000, + "train_batch_size": "auto", + "train_micro_batch_size_per_gpu": "auto", + "wall_clock_breakdown": false + }, + "debug": null, + "skip_memory_metrics": true, + "do_train": false, + "do_eval": false, + "do_predict": false, + "resume_from_checkpoint": null, + "warmup_ratio": 0.05, + "logging_dir": "/home/wangjunjie09/exps/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505/runs", + "local_rank": 0, + "sortish_sampler": false, + "predict_with_generate": false, + "generation_max_length": null, + "generation_num_beams": null, + "generation_config": null, + "tuner_backend": "peft", + "llm_checkpointing": 16, + "vit_gradient_checkpointing": true, + "router_aux_loss_coef": 0.0, + "enable_dft_loss": false, + "enable_channel_loss": false, + "safe_serialization": true, + "max_shard_size": "5GB", + "check_model": true, + "acc_strategy": "token", + "train_dataloader_shuffle": true, + "group_by_length": false, + "group_by_packed_video_cost": true, + "group_by_packed_compute_cost": false, + "group_by_packed_modality": false, + "max_epochs": null, + "aligner_lr": null, + "vit_lr": 1e-06, + "use_logits_to_keep": true, + "ds3_gather_for_generation": true, + "resume_only_model": false, + "optimizer": null, + "loss_type": null, + "eval_metric": null, + "callbacks": [], + "early_stop_interval": null, + "eval_use_evalscope": false, + "eval_dataset": [], + "eval_dataset_args": null, + "eval_limit": null, + "eval_generation_config": null, + "extra_eval_args": null, + "tuner_type": "full", + "use_galore": false, + "galore_target_modules": null, + "galore_rank": 128, + "galore_update_proj_gap": 50, + "galore_scale": 1.0, + "galore_proj_type": "std", + "galore_optim_per_parameter": false, + "galore_with_embedding": false, + "galore_quantization": false, + "galore_proj_quant": false, + "galore_proj_bits": 4, + "galore_proj_group_size": 256, + "galore_cos_threshold": 0.4, + "galore_gamma_proj": 2, + "galore_queue_size": 5, + "lisa_activated_layers": 0, + "lisa_step_interval": 20, + "use_flash_ckpt": false, + "use_ray": false, + "ray_exp_name": null, + "device_groups": null, + "model": "/home/wangjunjie09/VisionEncoder/V3_exps/S1/4b/aimv2_large/aimv2_large/v0-20261024-150052/checkpoint-2181", + "model_type": "llava_external_vit_qwen3", + "model_revision": null, + "task_type": "causal_lm", + "torch_dtype": "bfloat16", + "attn_impl": "flash_attn", + "experts_impl": null, + "new_special_tokens": [], + "num_labels": null, + "problem_type": null, + "rope_scaling": null, + "device_map": null, + "max_memory": {}, + "max_model_len": null, + "local_repo_path": null, + "init_strategy": null, + "template": "llava_external_vit_qwen3", + "system": null, + "max_length": 16384, + "truncation_strategy": "delete", + "max_pixels": null, + "agent_template": null, + "norm_bbox": null, + "use_chat_template": true, + "padding_side": "right", + "padding_free": true, + "loss_scale": "default", + "sequence_parallel_size": 1, + "template_backend": "swift", + "response_prefix": null, + "enable_thinking": null, + "add_non_thinking_prefix": true, + "dataset": [], + "val_dataset": [], + "cached_dataset": [ + "/share/m2v_intern/wangjunjie09/datasets/prepared/s2/img729_vid196/image_20pct/train", + "/share/m2v_intern/wangjunjie09/datasets/prepared/s2/img729_vid196/video_20pct/v2/train" + ], + "cached_val_dataset": [], + "split_dataset_ratio": 0.0, + "dataset_num_proc": 16, + "load_from_cache_file": false, + "dataset_shuffle": true, + "val_dataset_shuffle": false, + "streaming": false, + "interleave_prob": null, + "stopping_strategy": "first_exhausted", + "shuffle_buffer_size": 1000, + "download_mode": "reuse_dataset_if_exists", + "columns": {}, + "strict": false, + "model_name": null, + "model_author": null, + "custom_dataset_info": [], + "quant_method": null, + "quant_bits": null, + "hqq_axis": null, + "bnb_4bit_compute_dtype": "bfloat16", + "bnb_4bit_quant_type": "nf4", + "bnb_4bit_use_double_quant": true, + "bnb_4bit_quant_storage": null, + "max_new_tokens": 64, + "temperature": 0.0, + "top_k": null, + "top_p": null, + "repetition_penalty": null, + "num_beams": 1, + "stream": false, + "stop_words": [], + "logprobs": false, + "top_logprobs": null, + "structured_outputs_regex": null, + "train_type": null, + "adapters": [], + "external_plugins": [ + "video_mllm/training/model_plugin_external_vit.py", + "video_mllm/data/dataset_plugin.py", + "/home/wangjunjie09/VisionEncoder/video_mllm/training/log_spacing_plugin.py" + ], + "custom_register_path": [ + "/home/wangjunjie09/VisionEncoder/video_mllm/training/log_spacing_plugin.py" + ], + "model_kwargs": { + "vision_source_id": "aimv2_large_patch14_336_distilled", + "num_frames": 32, + "eval_frames": 32, + "s2_use_video_frame_cache": true, + "s2_video_frame_cache": "/share/m2v_intern_v3/wangjunjie09/datasets/video_cache/s2/frames/jpeg/384/32" + }, + "video_cache": {}, + "image_teacher_models": {}, + "load_args": false, + "load_data_args": false, + "packing": true, + "packing_length": 16384, + "packing_num_proc": 1, + "lazy_tokenize": false, + "use_hf": true, + "ignore_args_error": false, + "use_swift_lora": false, + "freeze_parameters": [], + "freeze_parameters_regex": null, + "freeze_parameters_ratio": 0.0, + "trainable_parameters": [ + "model.multi_modal_projector" + ], + "trainable_parameters_regex": null, + "freeze_llm": false, + "freeze_vit": false, + "freeze_aligner": false, + "target_modules": [ + "all-linear" + ], + "target_regex": null, + "target_parameters": null, + "modules_to_save": [], + "lora_rank": 8, + "lora_alpha": 32, + "lora_dropout": 0.05, + "lora_bias": "none", + "lora_dtype": null, + "lorap_lr_ratio": null, + "use_rslora": false, + "use_dora": false, + "lora_ga_batch_size": 2, + "lora_ga_iters": 2, + "lora_ga_max_length": 1024, + "lora_ga_direction": "ArB2r", + "lora_ga_scale": "stable", + "lora_ga_stable_gamma": 16, + "init_weights": true, + "fourier_n_frequency": 2000, + "fourier_scaling": 300.0, + "boft_block_size": 4, + "boft_block_num": 0, + "boft_n_butterfly_factor": 1, + "boft_dropout": 0.0, + "vera_rank": 256, + "vera_projection_prng_key": 0, + "vera_dropout": 0.0, + "vera_d_initial": 0.1, + "adapter_act": "gelu", + "adapter_length": 128, + "adalora_target_r": 8, + "adalora_init_r": 12, + "adalora_tinit": 0, + "adalora_tfinal": 0, + "adalora_deltaT": 1, + "adalora_beta1": 0.85, + "adalora_beta2": 0.85, + "adalora_orth_reg_weight": 0.5, + "llamapro_num_new_blocks": 4, + "llamapro_num_groups": null, + "reft_layer_key": null, + "reft_layers": null, + "reft_rank": 4, + "reft_intervention_type": "LoreftIntervention", + "reft_args": null, + "swanlab_token": null, + "swanlab_project": "ms-swift", + "swanlab_workspace": null, + "swanlab_exp_name": null, + "swanlab_notification_method": null, + "swanlab_webhook_url": null, + "swanlab_secret": null, + "swanlab_sender_email": null, + "swanlab_receiver_email": null, + "swanlab_smtp_server": null, + "swanlab_smtp_port": null, + "swanlab_email_language": "zh", + "swanlab_mode": "cloud", + "add_version": true, + "create_checkpoint_symlink": false, + "v12_resolution": 384, + "zero_hpz_partition_size": null, + "deepspeed_autotp_size": null, + "swift_version": "4.1.0.dev0", + "ckpt_dir": "/home/wangjunjie09/VisionEncoder/V3_exps/S1/4b/aimv2_large/aimv2_large/v0-20261024-150052/checkpoint-2181", + "rank": 0, + "global_world_size": 8, + "local_world_size": 8, + "model_suffix": "checkpoint-2181", + "model_info": "ModelInfo(model_type='llava_external_vit_qwen3', model_dir='/home/wangjunjie09/VisionEncoder/exps/S1/4b/aimv2_large/aimv2_large/v0-20261024-150052/checkpoint-2181', torch_dtype=torch.bfloat16, max_model_len=262144, quant_method=None, quant_bits=None, rope_scaling=None, is_moe_model=False, is_multimodal=True, config=None, task_type='causal_lm', num_labels=None)", + "model_meta": "ModelMeta(model_type='llava_external_vit_qwen3', model_groups=[ModelGroup(models=[Model(ms_model_id='Qwen/Qwen3-4B-Instruct-2507', hf_model_id='Qwen/Qwen3-4B-Instruct-2507', model_path=None, ms_revision=None, hf_revision=None)], template=None, ignore_patterns=None, requires=None, tags=[])], loader=, template='llava_external_vit_qwen3', model_arch=MultiModelKeys(arch_name='llava_hf', embedding=None, module_list=None, lm_head=None, q_proj=None, k_proj=None, v_proj=None, o_proj=None, attention=None, mlp=None, down_proj=None, qkv_proj=None, qk_proj=None, qa_proj=None, qb_proj=None, kv_proj=None, kva_proj=None, kvb_proj=None, language_model=['model.language_model', 'lm_head'], aligner=['model.multi_modal_projector'], vision_tower=['model.vision_tower'], generator=[]), architectures=['LlavaExternalViTForConditionalGeneration'], additional_saved_files=[], torch_dtype=None, is_multimodal=True, is_reward=False, task_type=None, ignore_patterns=None, requires=[], tags=['vision', 'video'])", + "model_dir": "/home/wangjunjie09/VisionEncoder/V3_exps/S1/4b/aimv2_large/aimv2_large/v0-20261024-150052/checkpoint-2181", + "template_meta": "QwenTemplateMeta(template_type='llava_external_vit_qwen3', prefix=[], prompt=['<|im_start|>user\\n{{QUERY}}<|im_end|>\\n<|im_start|>assistant\\n'], chat_sep=['<|im_end|>\\n'], suffix=['<|im_end|>\\n'], template_cls=, system_prefix=['<|im_start|>system\\n{{SYSTEM}}<|im_end|>\\n'], default_system=None, auto_add_bos=False, stop_words=['<|endoftext|>'], agent_template='hermes', is_thinking=False, thinking_prefix='', non_thinking_prefix='', history_thinking_prefix='')", + "_val_dataset_exists": false, + "hub": "", + "evaluation_strategy": "steps", + "training_args": "Seq2SeqTrainingArguments(output_dir='/home/wangjunjie09/exps/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505', per_device_train_batch_size=1, num_train_epochs=1.0, max_steps=-1, learning_rate=1e-05, lr_scheduler_type=, lr_scheduler_kwargs=None, warmup_steps=0.05, optim=, optim_args=None, weight_decay=0.1, adam_beta1=0.9, adam_beta2=0.95, adam_epsilon=1e-08, optim_target_modules=None, gradient_accumulation_steps=8, average_tokens_across_devices=None, max_grad_norm=1.0, label_smoothing_factor=0.0, bf16=True, fp16=False, bf16_full_eval=False, fp16_full_eval=False, tf32=None, gradient_checkpointing=True, gradient_checkpointing_kwargs={'use_reentrant': False}, torch_compile=False, torch_compile_backend=None, torch_compile_mode=None, use_liger_kernel=False, liger_kernel_config=None, use_cache=False, neftune_noise_alpha=None, torch_empty_cache_steps=None, auto_find_batch_size=False, logging_strategy=, logging_steps=5, logging_first_step=True, log_on_each_node=True, logging_nan_inf_filter=True, include_num_input_tokens_seen=None, log_level='passive', log_level_replica='warning', disable_tqdm=False, report_to=[], run_name='/home/wangjunjie09/exps/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505', project='huggingface', trackio_space_id='trackio', eval_strategy=, eval_steps=100.0, eval_delay=0, per_device_eval_batch_size=1, prediction_loss_only=False, eval_on_start=False, eval_do_concat_batches=True, eval_use_gather_object=False, eval_accumulation_steps=None, include_for_metrics=[], batch_eval_metrics=False, save_only_model=False, save_strategy=, save_steps=100, save_on_each_node=False, save_total_limit=1, enable_jit_checkpoint=False, push_to_hub=False, hub_token=None, hub_private_repo=None, hub_model_id=None, hub_strategy=, hub_always_push=False, hub_revision=None, load_best_model_at_end=False, metric_for_best_model='loss', greater_is_better=False, ignore_data_skip=False, restore_callback_states_from_checkpoint=False, full_determinism=False, seed=42, data_seed=42, use_cpu=False, accelerator_config=AcceleratorConfig(split_batches=False, dispatch_batches=False, even_batches=True, use_seedable_sampler=True, non_blocking=False, gradient_accumulation_kwargs=None, use_configured_state=False), parallelism_config=None, dataloader_drop_last=False, dataloader_num_workers=8, dataloader_pin_memory=True, dataloader_persistent_workers=True, dataloader_prefetch_factor=4, remove_unused_columns=False, label_names=None, train_sampling_strategy='random', length_column_name='length', ddp_find_unused_parameters=None, ddp_bucket_cap_mb=None, ddp_broadcast_buffers=None, ddp_backend=None, ddp_timeout=7200, fsdp=[], fsdp_config={'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}, deepspeed={'fp16': {'enabled': 'auto', 'loss_scale': 0, 'loss_scale_window': 1000, 'initial_scale_power': 16, 'hysteresis': 2, 'min_loss_scale': 1}, 'bf16': {'enabled': 'auto'}, 'zero_optimization': {'stage': 2, 'offload_optimizer': {'device': 'none', 'pin_memory': True}, 'allgather_partitions': True, 'allgather_bucket_size': 200000000.0, 'overlap_comm': False, 'reduce_scatter': True, 'reduce_bucket_size': 200000000.0, 'contiguous_gradients': True}, 'gradient_accumulation_steps': 'auto', 'gradient_clipping': 'auto', 'steps_per_print': 2000, 'train_batch_size': 'auto', 'train_micro_batch_size_per_gpu': 'auto', 'wall_clock_breakdown': False}, debug=[], skip_memory_metrics=True, do_train=False, do_eval=False, do_predict=False, resume_from_checkpoint=None, warmup_ratio=0.05, logging_dir='/home/wangjunjie09/exps/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505/runs', local_rank=0, sortish_sampler=False, predict_with_generate=False, generation_max_length=None, generation_num_beams=None, generation_config=None, tuner_backend='peft', llm_checkpointing=16, vit_gradient_checkpointing=True, router_aux_loss_coef=0.0, enable_dft_loss=False, enable_channel_loss=False, safe_serialization=True, max_shard_size='5GB', check_model=True, acc_strategy='token', train_dataloader_shuffle=True, group_by_length=False, group_by_packed_video_cost=True, group_by_packed_compute_cost=False, group_by_packed_modality=False, max_epochs=None, aligner_lr=None, vit_lr=1e-06, use_logits_to_keep=True, ds3_gather_for_generation=True, resume_only_model=False, optimizer='multimodal', loss_type=None, eval_metric=None, callbacks=[], early_stop_interval=None, eval_use_evalscope=False, eval_dataset=[], eval_dataset_args=None, eval_limit=None, eval_generation_config=None, extra_eval_args=None, tuner_type='full', use_galore=False, galore_target_modules=None, galore_rank=128, galore_update_proj_gap=50, galore_scale=1.0, galore_proj_type='std', galore_optim_per_parameter=False, galore_with_embedding=False, galore_quantization=False, galore_proj_quant=False, galore_proj_bits=4, galore_proj_group_size=256, galore_cos_threshold=0.4, galore_gamma_proj=2, galore_queue_size=5, lisa_activated_layers=0, lisa_step_interval=20, use_flash_ckpt=False)" +} diff --git a/ckpts/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505/checkpoint-2182/chat_template.jinja b/ckpts/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505/checkpoint-2182/chat_template.jinja new file mode 100644 index 0000000000000000000000000000000000000000..70adff8a08fb31e0636f618564838d4bf3c05286 --- /dev/null +++ b/ckpts/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505/checkpoint-2182/chat_template.jinja @@ -0,0 +1,61 @@ +{%- if tools %} + {{- '<|im_start|>system\n' }} + {%- if messages[0].role == 'system' %} + {{- messages[0].content + '\n\n' }} + {%- endif %} + {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within XML tags:\n" }} + {%- for tool in tools %} + {{- "\n" }} + {{- tool | tojson }} + {%- endfor %} + {{- "\n\n\nFor each function call, return a json object with function name and arguments within XML tags:\n\n{\"name\": , \"arguments\": }\n<|im_end|>\n" }} +{%- else %} + {%- if messages[0].role == 'system' %} + {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }} + {%- endif %} +{%- endif %} +{%- for message in messages %} + {%- if message.content is string %} + {%- set content = message.content %} + {%- else %} + {%- set content = '' %} + {%- endif %} + {%- if (message.role == "user") or (message.role == "system" and not loop.first) %} + {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }} + {%- elif message.role == "assistant" %} + {{- '<|im_start|>' + message.role + '\n' + content }} + {%- if message.tool_calls %} + {%- for tool_call in message.tool_calls %} + {%- if (loop.first and content) or (not loop.first) %} + {{- '\n' }} + {%- endif %} + {%- if tool_call.function %} + {%- set tool_call = tool_call.function %} + {%- endif %} + {{- '\n{"name": "' }} + {{- tool_call.name }} + {{- '", "arguments": ' }} + {%- if tool_call.arguments is string %} + {{- tool_call.arguments }} + {%- else %} + {{- tool_call.arguments | tojson }} + {%- endif %} + {{- '}\n' }} + {%- endfor %} + {%- endif %} + {{- '<|im_end|>\n' }} + {%- elif message.role == "tool" %} + {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %} + {{- '<|im_start|>user' }} + {%- endif %} + {{- '\n\n' }} + {{- content }} + {{- '\n' }} + {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %} + {{- '<|im_end|>\n' }} + {%- endif %} + {%- endif %} +{%- endfor %} +{%- if add_generation_prompt %} + {{- '<|im_start|>assistant\n' }} +{%- endif %} \ No newline at end of file diff --git a/ckpts/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505/checkpoint-2182/chat_template.json b/ckpts/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505/checkpoint-2182/chat_template.json new file mode 100644 index 0000000000000000000000000000000000000000..68724c68b1612e9ab2e31f84e3279099ad656ff6 --- /dev/null +++ b/ckpts/S2/4b/aimv2_large/aimv2_large/v0-20261024-210505/checkpoint-2182/chat_template.json @@ -0,0 +1,3 @@ +{ + "chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + ' '}}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '' }}{% endfor %}{# Render all video then #}{% for content in message['content'] | selectattr('type', 'equalto', 'video') %}{{ '