Skip to content

fix: avoid mutable default for BaseTrainerModel.inference aux_input - #4431

Closed
Solaris-star wants to merge 1 commit into
coqui-ai:devfrom
Solaris-star:fix/4427-mutable-defaults
Closed

fix: avoid mutable default for BaseTrainerModel.inference aux_input#4431
Solaris-star wants to merge 1 commit into
coqui-ai:devfrom
Solaris-star:fix/4427-mutable-defaults

Conversation

@Solaris-star

Copy link
Copy Markdown

Summary

BaseTrainerModel.inference used a mutable default (aux_input={}), which is shared across calls at definition time.

Use Optional[Dict] = None instead (Python ≥3.9). Concrete subclasses already use None or explicit dict literals in their overrides; this only cleans the abstract base signature.

Fixes #4427

Testing

Signature-only change on the abstract base; no runtime path change beyond default construction.

Replace aux_input={} with Optional[Dict] = None so the abstract
signature does not share a single dict across calls.

Fixes #4427

Signed-off-by: Solaris-star <820622658@qq.com>
@CLAassistant

CLAassistant commented Jul 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Solaris-star Solaris-star closed this by deleting the head repository Aug 12, 2026
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.

Fix mutable default argument in model.py

2 participants