Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
2ea1ef90
Unverified
Commit
2ea1ef90
authored
Feb 27, 2023
by
Tianqi Zhang (张天启)
Committed by
GitHub
Feb 27, 2023
Browse files
[FX tracer] Make `concrete_args` from outside available (#21775)
make concrete_args from outside available
parent
ba2a5f13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
src/transformers/utils/fx.py
src/transformers/utils/fx.py
+7
-1
No files found.
src/transformers/utils/fx.py
View file @
2ea1ef90
...
...
@@ -984,7 +984,13 @@ class HFTracer(Tracer):
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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment