fix: correct 'Unsupport' typo to 'Unsupported' in error messages#1320
fix: correct 'Unsupport' typo to 'Unsupported' in error messages#1320SuperMarioYL wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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.
| 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)) |
There was a problem hiding this comment.
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.
| 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)) |
There was a problem hiding this comment.
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.
| 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)) |
There was a problem hiding this comment.
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.
| 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)) |
There was a problem hiding this comment.
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.
| 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)) |
There was a problem hiding this comment.
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.
| 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)) |
There was a problem hiding this comment.
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.
| 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") |
There was a problem hiding this comment.
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.
| 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)) |
There was a problem hiding this comment.
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.
| 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)) |
There was a problem hiding this comment.
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.
| raise Exception("Unsupported input types: {} for {}".format(type(img), img)) | |
| raise TypeError(f"Unsupported input type: {type(img)} for {img}") |
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
Unsupport(with trailing space) across 13 filesrecievedAll changes are string-only — there is no behavior change. Touched files:
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
python -m py_compile(syntax-only check)grep -rn \"Unsupport \" --include='*.py' lightllm/returns zero matches after the change