Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Click converts lists into tuples when parsing args #2061

@RobotSail

Description

@RobotSail

Describe the bug

When ilab receives a list in a specific way, for example when ilab model train receives the lora_target_modules parameter, Click performs some magic under the hood which automatically converts the list into a tuple.

Oftentimes though this is not behavior which we want, since we naturally expect the specific list data structure
under the hood in many of our type signatures. For example leading to the error which was solved by this PR: #2026

/opt/app-root/lib64/python3.11/site-packages/pydantic/main.py:364: UserWarning: Pydantic serializer warnings:
  Expected `list[str]` but got `tuple` - serialized value may not be as expected
  return self.__pydantic_serializer__.to_python(

To Reproduce
Steps to reproduce the behavior:

  1. Check out any commit prior to when Enforce list type for lora-target-modules #2026 was merged (if it's merged by then)
  2. Run ilab model train

Expected behavior

No warning message appears

Device Info (please complete the following information):

  • Hardware Specs: [e.g. Apple M2 Pro Chip, 16 GB Memory, etc.]
  • OS Version: [e.g. Mac OS 14.4.1, Fedora Linux 40]
  • Python Version: [output of python --version]
  • InstructLab Version: [output of ilab --version]

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfunctionalIssues that require a code changejiraThis triggers jira syncstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions