Skip to content

[Model] add Step 3.7 Flash#46562

Open
ltd0924 wants to merge 19 commits into
huggingface:mainfrom
ltd0924:main
Open

[Model] add Step 3.7 Flash#46562
ltd0924 wants to merge 19 commits into
huggingface:mainfrom
ltd0924:main

Conversation

@ltd0924

@ltd0924 ltd0924 commented Jun 11, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes # (issue)
add new model Step 3.7 Flash

Code Agent Policy

The Transformers repo is currently being overwhelmed by a large number of PRs and issue comments written by
code agents. We are currently bottlenecked by our ability to review and respond to them. As a result,
we ask that new users do not submit pure code agent PRs at this time.
You may use code agents in drafting or to help you diagnose issues. We'd also ask autonomous "OpenClaw"-like agents
not to open any PRs or issues for the moment.

PRs that appear to be fully agent-written will probably be closed without review, and we may block users who do this
repeatedly or maliciously.

This is a rapidly-evolving situation that's causing significant shockwaves in the open-source community. As a result,
this policy is likely to be updated regularly in the near future. For more information, please read CONTRIBUTING.md.

  • I confirm that this is not a pure code agent PR.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

cc @zucchini-nlp

luotingdan added 5 commits June 11, 2026 15:51
Vision-language model with a per-layer rope_theta text decoder (yarn-only
attention layers) and a 4x-downsampled ViT projector. Wires up Step3p7Config /
Step3p7Model / Step3p7ForConditionalGeneration in the modular file, registers
auto-class mappings, and ships a smoke-test script.

Notable behaviors:
- prepare_inputs_for_generation gates pixel_values on kwargs["is_first_iteration"]
  (Llava convention) since generate() pre-creates an empty cache, so neither
  past_key_values is None nor cache_position[0]==0 is a reliable prefill signal.
- from_pretrained explicitly forwards _checkpoint_conversion_mapping as key_mapping
  because inheriting the class attribute alone is not enough.
- Step3p7RotaryEmbedding shallow-copies the shared text config and deep-copies
  rope_parameters so per-layer rope_theta scalars do not leak between siblings.
@zucchini-nlp

Copy link
Copy Markdown
Member

hey @ltd0924

Great addition! Before I step in for review, can you pass over the PR and check if model matches the guidelines from this doc page (https://huggingface.co/docs/transformers/en/modular_transformers)? There is also a guide on adding processors if you scroll to the next doc page

Currently I am seeing a few nits, such as the naming (we need to add the model name in all classes, e.g. instead of simply class Encoder, use class Step3_7Encoder), configurations must be a dataclass since v5, model-doc missing, modular isn't used enough (you can try python utils/modular_model_detector.py to see where to inherit from) and there are no modeling tests (needs to inherit from VLMTester)

I will review after the above points are addressed and the CI is green :) Tag me when you're ready, for now I'll unsubscribe from getting notif

@github-actions

Copy link
Copy Markdown
Contributor

CI Dashboard: View test results in Grafana

@github-actions

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: auto, step3p7

@github-actions

Copy link
Copy Markdown
Contributor

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=46562&sha=166a10

@ltd0924

ltd0924 commented Jun 13, 2026

Copy link
Copy Markdown
Author

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=46562&sha=166a10
The failed test was not caused by this PR; all other issues have been fixed. Please review it.
cc @zucchini-nlp

@zucchini-nlp

Copy link
Copy Markdown
Member

Taking a look next week, thanks for the ping

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