Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
fea94d67
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "d83ff5eeff1d5360052a66074dde1f87bd9f3a21"
Unverified
Commit
fea94d67
authored
Apr 25, 2022
by
Sanchit Gandhi
Committed by
GitHub
Apr 25, 2022
Browse files
Replace deprecated logger.warn with warning (#16876)
parent
e03966e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
examples/research_projects/quantization-qdqbert/quant_trainer.py
...s/research_projects/quantization-qdqbert/quant_trainer.py
+1
-1
src/transformers/configuration_utils.py
src/transformers/configuration_utils.py
+1
-1
src/transformers/modeling_flax_utils.py
src/transformers/modeling_flax_utils.py
+1
-1
No files found.
examples/research_projects/quantization-qdqbert/quant_trainer.py
View file @
fea94d67
...
@@ -269,7 +269,7 @@ def set_quantizer(name, mod, quantizer, k, v):
...
@@ -269,7 +269,7 @@ def set_quantizer(name, mod, quantizer, k, v):
assert
hasattr
(
quantizer_mod
,
k
)
assert
hasattr
(
quantizer_mod
,
k
)
setattr
(
quantizer_mod
,
k
,
v
)
setattr
(
quantizer_mod
,
k
,
v
)
else
:
else
:
logger
.
warn
(
f
"
{
name
}
has no
{
quantizer
}
"
)
logger
.
warn
ing
(
f
"
{
name
}
has no
{
quantizer
}
"
)
def
set_quantizers
(
name
,
mod
,
which
=
"both"
,
**
kwargs
):
def
set_quantizers
(
name
,
mod
,
which
=
"both"
,
**
kwargs
):
...
...
src/transformers/configuration_utils.py
View file @
fea94d67
...
@@ -306,7 +306,7 @@ class PretrainedConfig(PushToHubMixin):
...
@@ -306,7 +306,7 @@ class PretrainedConfig(PushToHubMixin):
if
self
.
id2label
is
not
None
:
if
self
.
id2label
is
not
None
:
num_labels
=
kwargs
.
pop
(
"num_labels"
,
None
)
num_labels
=
kwargs
.
pop
(
"num_labels"
,
None
)
if
num_labels
is
not
None
and
len
(
self
.
id2label
)
!=
num_labels
:
if
num_labels
is
not
None
and
len
(
self
.
id2label
)
!=
num_labels
:
logger
.
warn
(
logger
.
warn
ing
(
f
"You passed along `num_labels=
{
num_labels
}
` with an incompatible id to label map: "
f
"You passed along `num_labels=
{
num_labels
}
` with an incompatible id to label map: "
f
"
{
self
.
id2label
}
. The number of labels wil be overwritten to
{
self
.
num_labels
}
."
f
"
{
self
.
id2label
}
. The number of labels wil be overwritten to
{
self
.
num_labels
}
."
)
)
...
...
src/transformers/modeling_flax_utils.py
View file @
fea94d67
...
@@ -641,7 +641,7 @@ class FlaxPreTrainedModel(PushToHubMixin, FlaxGenerationMixin):
...
@@ -641,7 +641,7 @@ class FlaxPreTrainedModel(PushToHubMixin, FlaxGenerationMixin):
unexpected_keys
=
set
(
state
.
keys
())
-
model
.
required_params
unexpected_keys
=
set
(
state
.
keys
())
-
model
.
required_params
if
missing_keys
and
not
_do_init
:
if
missing_keys
and
not
_do_init
:
logger
.
warn
(
logger
.
warn
ing
(
f
"The checkpoint
{
pretrained_model_name_or_path
}
is missing required keys:
{
missing_keys
}
. "
f
"The checkpoint
{
pretrained_model_name_or_path
}
is missing required keys:
{
missing_keys
}
. "
f
"Make sure to call model.init_weights to initialize the missing weights."
f
"Make sure to call model.init_weights to initialize the missing weights."
)
)
...
...
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