Skip to content

Clarify set_adapters() adapter_weights documentation and type hints #15146

Open

Description

@gorkadabo1

Follow-up to #15128.

During the review of #15128, @BenjaminBossan suggested improving the adapter_weights docstring and type annotation in LoraBaseMixin.set_adapters(), and @sayakpaul agreed. The PR was merged before I could include these changes. On current main, the docstring still describes adapter_weights as list[float, float], but the method also accepts scalars, dictionaries, lists of weights, and None. The type annotation also uses dict without specifying the key and value types.

A small follow-up could:

  • Explain the supported weight formats and how the same component-weight dictionary is used for multiple adapters.
  • Explain per-adapter and nested component weights where supported.
  • Make the type annotation more specific without changing how the method works.

I already wrote and tested these changes while working on #15128. Would a small follow-up PR for these changes be appropriate?

Activity

  1. sayakpaul commented on Oct 30, 2026

    @sayakpaul
    Member

    Please open a PR. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions