modelscope / modelscope/ms-swift

gemma-4图像怎么设置最大token数量

Open
#9,064 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question stale
Dominant language
Python
Stars
15.7k
Forks
1.7k
Avg merge
1d 16h
Merged PRs (30d)
136

Description

Checklist / 检查清单
  • I have searched existing issues, and this is a new question or discussion topic. / 我已经搜索过现有的 issues,确认这是一个新的问题与讨论。
Question Description / 问题描述

全参微调gemma-4时,怎么控制每张图像的最大token数量呢?max_pixels似乎没作用,我设置50176后,最后每张图片token竟然是200+,但是在qwen3系列时,就是49个token

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the full-parameter Gemma-4 setup described in the issue with max_pixels set to 50176, then compare the resulting image-token count with the Qwen3 behavior. Trace the image preprocessing or tokenization path used by each model; done means explaining whether max_pixels should limit Gemma-4 to the requested size and fixing or documenting the discrepancy.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.