Skip to content

fix: correct 'Unsupport' typo to 'Unsupported' in error messages#1320

Open
SuperMarioYL wants to merge 1 commit into
ModelTC:mainfrom
SuperMarioYL:fix/typo-unsupported-error-messages
Open

fix: correct 'Unsupport' typo to 'Unsupported' in error messages#1320
SuperMarioYL wants to merge 1 commit into
ModelTC:mainfrom
SuperMarioYL:fix/typo-unsupported-error-messages

Conversation

@SuperMarioYL
Copy link
Copy Markdown

What

Small drive-by fix: the error/log messages used "Unsupport datatype", "Unsupport input types", etc., which read as ungrammatical when surfaced to users. This PR corrects the wording to "Unsupported" across all sites.

While I was here I also fixed one "recieved" -> "received" typo in config_server/api_http.py.

Scope

  • 20 occurrences of Unsupport (with trailing space) across 13 files
  • 1 occurrence of recieved

All changes are string-only — there is no behavior change. Touched files:

lightllm/models/gemma3/gemma3_visual.py
lightllm/models/internvl/internvl_visual.py
lightllm/models/llava/llava_visual.py
lightllm/models/qwen2_5_vl/qwen2_5_visual.py
lightllm/models/qwen2_vl/qwen2_visual.py
lightllm/models/qwen3_omni_moe_thinker/qwen3_omni_audio.py
lightllm/models/qwen3_omni_moe_thinker/qwen3_omni_visual.py
lightllm/models/qwen3_vl/qwen3_visual.py
lightllm/models/qwen_vl/qwen_visual.py
lightllm/models/tarsier2/tarsier2_visual.py
lightllm/models/vit/model.py
lightllm/server/config_server/api_http.py
lightllm/utils/envs_utils.py
lightllm/utils/torch_dtype_utils.py

Why

Error messages are part of the public-facing surface — when a user passes an unsupported image type or dtype, the message they see is the only signal they get. Correct wording makes the diagnosis a little easier and the project look more polished.

Verification

  • All touched files pass python -m py_compile (syntax-only check)
  • grep -rn \"Unsupport \" --include='*.py' lightllm/ returns zero matches after the change
  • No imports added or removed; no API change

The error/log messages used 'Unsupport datatype', 'Unsupport input
types', etc., which read as ungrammatical. Switch to 'Unsupported'
across all visual/audio model files and shared utilities. Also fix
'recieved' -> 'received' in the visual websocket log line.

Pure string-only change, no behavior change.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request corrects several typos across multiple files, primarily fixing "Unsupport" to "Unsupported" and "recieved" to "received" in error messages and logs. The reviewer suggests further improving these error-handling paths by raising more specific exceptions (such as TypeError or ValueError instead of a generic Exception) and using modern f-strings instead of .format() for better readability and Pythonic consistency.

img_tensors.append(t)
else:
raise Exception("Unsupport input types: {} for {}".format(type(img), img))
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Raising a generic Exception is discouraged in Python. It is better to raise a more specific exception like TypeError when encountering an unsupported input type. Additionally, using f-strings is preferred over .format() for better readability and consistency.

Suggested change
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
raise TypeError(f"Unsupported input type: {type(img)} for {img}")

img_tensors.append(t)
else:
raise Exception("Unsupport input types: {} for {}".format(type(img), img))
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Raising a generic Exception is discouraged in Python. It is better to raise a more specific exception like TypeError when encountering an unsupported input type. Additionally, using f-strings is preferred over .format() for better readability and consistency.

Suggested change
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
raise TypeError(f"Unsupported input type: {type(img)} for {img}")

img_tensors.append(t)
else:
raise Exception("Unsupport input types: {} for {}".format(type(img), img))
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Raising a generic Exception is discouraged in Python. It is better to raise a more specific exception like TypeError when encountering an unsupported input type. Additionally, using f-strings is preferred over .format() for better readability and consistency.

Suggested change
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
raise TypeError(f"Unsupported input type: {type(img)} for {img}")

pixel_values, image_grid_thw = self.processor.preprocess(image_data)
else:
raise Exception("Unsupport input types: {} for {}".format(type(img), img))
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Raising a generic Exception is discouraged in Python. It is better to raise a more specific exception like TypeError when encountering an unsupported input type. Additionally, using f-strings is preferred over .format() for better readability and consistency.

Suggested change
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
raise TypeError(f"Unsupported input type: {type(img)} for {img}")

img_grids.append(image_grid_thw)
else:
raise Exception("Unsupport input types: {} for {}".format(type(img), img))
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Raising a generic Exception is discouraged in Python. It is better to raise a more specific exception like TypeError when encountering an unsupported input type. Additionally, using f-strings is preferred over .format() for better readability and consistency.

Suggested change
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
raise TypeError(f"Unsupported input type: {type(img)} for {img}")

img_grids.append(image_grid_thw)
else:
raise Exception("Unsupport input types: {} for {}".format(type(img), img))
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Raising a generic Exception is discouraged in Python. It is better to raise a more specific exception like TypeError when encountering an unsupported input type. Additionally, using f-strings is preferred over .format() for better readability and consistency.

Suggested change
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
raise TypeError(f"Unsupported input type: {type(img)} for {img}")

img_tensors.append(t)
else:
raise Exception("Unsupport input types: {} for {}".format(type(item), item))
raise Exception("Unsupported input types: {} for {}".format(type(item), item))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Raising a generic Exception is discouraged in Python. It is better to raise a more specific exception like TypeError when encountering an unsupported input type. Additionally, using f-strings is preferred over .format() for better readability and consistency.

Suggested change
raise Exception("Unsupported input types: {} for {}".format(type(item), item))
raise TypeError(f"Unsupported input type: {type(item)} for {item}")

)
elif projection_head == "auto_map":
raise Exception("Unsupport projection_head auto_map")
raise Exception("Unsupported projection_head auto_map")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Raising a generic Exception is discouraged in Python. It is better to raise a more specific exception like ValueError when encountering an unsupported configuration value.

Suggested change
raise Exception("Unsupported projection_head auto_map")
raise ValueError("Unsupported projection_head auto_map")

img_grids.append(image_grid_thw)
else:
raise Exception("Unsupport input types: {} for {}".format(type(img), img))
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Raising a generic Exception is discouraged in Python. It is better to raise a more specific exception like TypeError when encountering an unsupported input type. Additionally, using f-strings is preferred over .format() for better readability and consistency.

Suggested change
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
raise TypeError(f"Unsupported input type: {type(img)} for {img}")

img_tensors.append(t)
else:
raise Exception("Unsupport input types: {} for {}".format(type(img), img))
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Raising a generic Exception is discouraged in Python. It is better to raise a more specific exception like TypeError when encountering an unsupported input type. Additionally, using f-strings is preferred over .format() for better readability and consistency.

Suggested change
raise Exception("Unsupported input types: {} for {}".format(type(img), img))
raise TypeError(f"Unsupported input type: {type(img)} for {img}")

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