Skip to content

Conversation

guanwei49
Copy link
Contributor

@guanwei49 guanwei49 commented May 22, 2025

When user set customized 'input_size' instead of 448, the original version will raise exception, due to the dynamic of 'num_image_token'. we change the 'num_image_token' according to the 'input_size' dynamically.

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

Write the detail information belongs to this PR.

Experiment results

Paste your experiment result here(if needed).

…_SIZE.

When user set customized 'input_size' instead of 448, the original version will raise exception, due to the dynamic of 'num_image_token'. we change the 'num_image_token' according to the 'input_size' dynamically.
@Jintao-Huang
Copy link
Collaborator

thanks! ❤️

@Jintao-Huang
Copy link
Collaborator

Please run the following code:

pip install pre-commit
pre-commit run --all-files

@guanwei49
Copy link
Contributor Author

image
我这边运行好像是没有fail的

@guanwei49
Copy link
Contributor Author

image
如果直接运行命令,不知道为什么找不到文件?

@Jintao-Huang
Copy link
Collaborator

改成这样试试 self.num_image_token = int((input_size // 14)**2 * (0.5**2))

@guanwei49
Copy link
Contributor Author

已修改,谢谢!

@Jintao-Huang Jintao-Huang merged commit 67271bb into modelscope:main May 22, 2025
2 checks passed
tastelikefeet added a commit to tastelikefeet/swift that referenced this pull request May 23, 2025
…o_padding_ulysses

* commit 'e9475f1a306614b30fc6314cc08eb5b40a3f17aa':
  qwen2_5_vl support video use image_dir (modelscope#4326)
  [megatron] Add extra args and provider support for easily customize megatron (modelscope#4240)
  Update internvl.py, solve the exception when setting customized INPUT_SIZE. (modelscope#4320)
  [grpo] support liger loss (modelscope#3781)
  compat transformer_engine update (modelscope#4317)
  compat transformers==4.52 (modelscope#4308)
  [grpo] support dp in external mode (modelscope#4279)
  fix vllm engine return empty in stream generation (modelscope#4303)
  fix (modelscope#4316)
  update swift image (modelscope#4309)
  update load_args (modelscope#4296)
  fix n > 1 with vLLM V1 Engine (modelscope#4295)
  Reuse existing code
  [grpo] fix num of reward_model > 1  (modelscope#4287)
  modify grpo system
  fix grpo tab
  support grpo web_ui

# Conflicts:
#	swift/trainers/sequence_parallel/ulysses.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants