Skip to content

Conversation

@slin000111
Copy link
Collaborator

@slin000111 slin000111 commented Sep 9, 2025

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

Write the detail information belongs to this PR.

  1. Fix multiple input issue, such as dataset.
  2. Fix more_params parameter parsing error, #issue 5551.

Experiment results

Paste your experiment result here(if needed).

Copy link
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.

Summary of Changes

Hello @slin000111, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses critical argument parsing issues within the web UI components, specifically for handling multiple inputs and additional parameters. The changes ensure that command-line arguments are correctly formatted and passed to underlying processes, resolving functional errors related to data input and custom parameter usage.

Highlights

  • Corrected Argument Parsing for List Inputs: Modified the command construction logic across several UI modules to correctly handle list-type arguments, ensuring each item in a list is passed as a separate argument rather than a single space-separated string.
  • Resolved more_params Parsing Error: Fixed an issue where the more_params command-line argument was not being parsed correctly, specifically addressing the problem reported in #issue 5551 by ensuring additional parameters are split and extended as individual arguments.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 correctly fixes an issue with handling multiple input arguments and parsing more_params in the web UI command generation logic. The changes ensure that list-like arguments are passed as separate command-line arguments, which is the expected behavior. My review includes several suggestions to simplify the code by removing redundant list comprehensions. These changes will improve code conciseness and readability across the modified files.

if isinstance(kwargs[e], list):
params += f'--{e} {cls.quote}{sep.join(kwargs[e])}{cls.quote} '
command.extend([f'--{e}', f'{" ".join(kwargs[e])}'])
command.extend([f'--{e}'] + [arg for arg in kwargs[e]])
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The list comprehension [arg for arg in kwargs[e]] is redundant as it just creates a copy of kwargs[e]. You can use kwargs[e] directly to make the code more concise.

Suggested change
command.extend([f'--{e}'] + [arg for arg in kwargs[e]])
command.extend([f'--{e}'] + kwargs[e])

more_params_cmd = [param.split(' ') for param in more_params_cmd if param]
for param in more_params_cmd:
command.extend([f'--{param[0]}', ' '.join(param[1:])])
command.extend([f'--{param[0]}'] + [arg for arg in param[1:]])
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The list comprehension [arg for arg in param[1:]] is redundant as it just creates a copy of the list slice param[1:]. You can use the slice directly to make the code more concise.

Suggested change
command.extend([f'--{param[0]}'] + [arg for arg in param[1:]])
command.extend([f'--{param[0]}'] + param[1:])

if isinstance(kwargs[e], list):
params += f'--{e} {cls.quote}{sep.join(kwargs[e])}{cls.quote} '
command.extend([f'--{e}', f'{" ".join(kwargs[e])}'])
command.extend([f'--{e}'] + [arg for arg in kwargs[e]])
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The list comprehension [arg for arg in kwargs[e]] is redundant as it just creates a copy of kwargs[e]. You can use kwargs[e] directly to make the code more concise.

Suggested change
command.extend([f'--{e}'] + [arg for arg in kwargs[e]])
command.extend([f'--{e}'] + kwargs[e])

more_params_cmd = [param.split(' ') for param in more_params_cmd if param]
for param in more_params_cmd:
command.extend([f'--{param[0]}', ' '.join(param[1:])])
command.extend([f'--{param[0]}'] + [arg for arg in param[1:]])
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The list comprehension [arg for arg in param[1:]] is redundant as it just creates a copy of the list slice param[1:]. You can use the slice directly to make the code more concise.

Suggested change
command.extend([f'--{param[0]}'] + [arg for arg in param[1:]])
command.extend([f'--{param[0]}'] + param[1:])

if isinstance(kwargs[e], list):
params += f'--{e} {cls.quote}{sep.join(kwargs[e])}{cls.quote} '
command.extend([f'--{e}', f'{" ".join(kwargs[e])}'])
command.extend([f'--{e}'] + [arg for arg in kwargs[e]])
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The list comprehension [arg for arg in kwargs[e]] is redundant as it just creates a copy of kwargs[e]. You can use kwargs[e] directly to make the code more concise.

Suggested change
command.extend([f'--{e}'] + [arg for arg in kwargs[e]])
command.extend([f'--{e}'] + kwargs[e])

more_params_cmd = [param.split(' ') for param in more_params_cmd if param]
for param in more_params_cmd:
command.extend([f'--{param[0]}', ' '.join(param[1:])])
command.extend([f'--{param[0]}'] + [arg for arg in param[1:]])
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The list comprehension [arg for arg in param[1:]] is redundant as it just creates a copy of the list slice param[1:]. You can use the slice directly to make the code more concise.

Suggested change
command.extend([f'--{param[0]}'] + [arg for arg in param[1:]])
command.extend([f'--{param[0]}'] + param[1:])

if isinstance(kwargs[e], list):
params += f'--{e} {cls.quote}{sep.join(kwargs[e])}{cls.quote} '
command.extend([f'--{e}', f'{" ".join(kwargs[e])}'])
command.extend([f'--{e}'] + [arg for arg in kwargs[e]])
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The list comprehension [arg for arg in kwargs[e]] is redundant as it just creates a copy of kwargs[e]. You can use kwargs[e] directly to make the code more concise.

Suggested change
command.extend([f'--{e}'] + [arg for arg in kwargs[e]])
command.extend([f'--{e}'] + kwargs[e])

more_params_cmd = [param.split(' ') for param in more_params_cmd if param]
for param in more_params_cmd:
command.extend([f'--{param[0]}', ' '.join(param[1:])])
command.extend([f'--{param[0]}'] + [arg for arg in param[1:]])
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The list comprehension [arg for arg in param[1:]] is redundant as it just creates a copy of the list slice param[1:]. You can use the slice directly to make the code more concise.

Suggested change
command.extend([f'--{param[0]}'] + [arg for arg in param[1:]])
command.extend([f'--{param[0]}'] + param[1:])

if isinstance(kwargs[e], list):
params += f'--{e} {cls.quote}{sep.join(kwargs[e])}{cls.quote} '
command.extend([f'--{e}', f'{" ".join(kwargs[e])}'])
command.extend([f'--{e}'] + [arg for arg in kwargs[e]])
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The list comprehension [arg for arg in kwargs[e]] is redundant as it just creates a copy of kwargs[e]. You can use kwargs[e] directly to make the code more concise.

Suggested change
command.extend([f'--{e}'] + [arg for arg in kwargs[e]])
command.extend([f'--{e}'] + kwargs[e])

more_params_cmd = [param.split(' ') for param in more_params_cmd if param]
for param in more_params_cmd:
command.extend([f'--{param[0]}', ' '.join(param[1:])])
command.extend([f'--{param[0]}'] + [arg for arg in param[1:]])
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The list comprehension [arg for arg in param[1:]] is redundant as it just creates a copy of the list slice param[1:]. You can use the slice directly to make the code more concise.

Suggested change
command.extend([f'--{param[0]}'] + [arg for arg in param[1:]])
command.extend([f'--{param[0]}'] + param[1:])

@slin000111 slin000111 merged commit c728dc0 into modelscope:main Sep 10, 2025
1 of 2 checks passed
Jintao-Huang pushed a commit that referenced this pull request Sep 15, 2025
* fix multiple input issues and more_params for web-ui

* remove unnecessary list comprehensions
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