Skip to content

fix: normalize image URL content type#5

Open
z2z23n0 wants to merge 1 commit into
OpenMOSS:mainfrom
z2z23n0:fix/normalize-image-url-content
Open

fix: normalize image URL content type#5
z2z23n0 wants to merge 1 commit into
OpenMOSS:mainfrom
z2z23n0:fix/normalize-image-url-content

Conversation

@z2z23n0

@z2z23n0 z2z23n0 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Normalize message content items from type: "image_url" to the model-supported type: "image" before offline inference.
  • Preserve the existing image_url value and remote/local path handling.
  • Add regression coverage for the normalized model input.

Why

The inference wrapper treated type: "image_url" content as image input, but the model only emits an image token for type: "image" or items with an image field. As a result, an image_url item could reach the model without a vision token and silently run as text-only inference.

Validation

  • python3 -m unittest inference.tests.test_run_inference
  • uvx ruff check inference/run_inference.py inference/tests/test_run_inference.py
  • git diff --check

@z2z23n0 z2z23n0 marked this pull request as ready for review July 15, 2026 04:27
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.

1 participant