Skip to content

Commit

Permalink
[FX tracer] Make concrete_args from outside available (#21775)
Browse files Browse the repository at this point in the history
make concrete_args from outside available
  • Loading branch information
lygztq authored Feb 27, 2023
1 parent ba2a5f1 commit 2ea1ef9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/transformers/utils/fx.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,13 @@ def trace(
continue
if param.default is inspect.Parameter.empty:
raise ValueError(f"You need to specify a default value for the parameter {param.name}.")
concrete_args.update({p.name: p.default for p in sig.parameters.values() if p.name not in dummy_inputs})
concrete_args.update(
{
p.name: p.default
for p in sig.parameters.values()
if (p.name not in dummy_inputs and p.name not in concrete_args)
}
)

input_names = sig.parameters.keys() - concrete_args.keys()

Expand Down

0 comments on commit 2ea1ef9

Please sign in to comment.