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
891704b3
Unverified
Commit
891704b3
authored
Aug 23, 2022
by
Nicolas Patry
Committed by
GitHub
Aug 23, 2022
Browse files
Removing warning of model type for `microsoft/tapex-base-finetuned-wtq` (#18711)
and friends.
parent
84beb8a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
src/transformers/pipelines/table_question_answering.py
src/transformers/pipelines/table_question_answering.py
+15
-4
No files found.
src/transformers/pipelines/table_question_answering.py
View file @
891704b3
...
@@ -16,14 +16,20 @@ from .base import PIPELINE_INIT_ARGS, ArgumentHandler, Dataset, Pipeline, Pipeli
...
@@ -16,14 +16,20 @@ from .base import PIPELINE_INIT_ARGS, ArgumentHandler, Dataset, Pipeline, Pipeli
if
is_torch_available
():
if
is_torch_available
():
import
torch
import
torch
from
..models.auto.modeling_auto
import
MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING
from
..models.auto.modeling_auto
import
(
MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING
,
MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING
,
)
if
is_tf_available
()
and
is_tensorflow_probability_available
():
if
is_tf_available
()
and
is_tensorflow_probability_available
():
import
tensorflow
as
tf
import
tensorflow
as
tf
import
tensorflow_probability
as
tfp
import
tensorflow_probability
as
tfp
from
..models.auto.modeling_tf_auto
import
TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING
from
..models.auto.modeling_tf_auto
import
(
TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING
,
TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING
,
)
class
TableQuestionAnsweringArgumentHandler
(
ArgumentHandler
):
class
TableQuestionAnsweringArgumentHandler
(
ArgumentHandler
):
...
@@ -100,9 +106,14 @@ class TableQuestionAnsweringPipeline(Pipeline):
...
@@ -100,9 +106,14 @@ class TableQuestionAnsweringPipeline(Pipeline):
self
.
_args_parser
=
args_parser
self
.
_args_parser
=
args_parser
self
.
check_model_type
(
self
.
check_model_type
(
TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING
dict
(
TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING
.
items
()
+
TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING
.
items
()
)
if
self
.
framework
==
"tf"
if
self
.
framework
==
"tf"
else
MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING
else
dict
(
MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING
.
items
()
+
MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING
.
items
()
)
)
)
self
.
aggregate
=
bool
(
getattr
(
self
.
model
.
config
,
"aggregation_labels"
,
None
))
and
bool
(
self
.
aggregate
=
bool
(
getattr
(
self
.
model
.
config
,
"aggregation_labels"
,
None
))
and
bool
(
...
...
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