Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/transformers/pipelines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,12 @@
# any tokenizer/feature_extractor might be use for a given model so we cannot
# use the statically defined TOKENIZER_MAPPING and FEATURE_EXTRACTOR_MAPPING to
# see if the model defines such objects or not.
MULTI_MODEL_CONFIGS = {"SpeechEncoderDecoderConfig", "VisionEncoderDecoderConfig", "VisionTextDualEncoderConfig"}
MULTI_MODEL_CONFIGS = {
"SpeechEncoderDecoderConfig",
"VisionEncoderDecoderConfig",
"VisionTextDualEncoderConfig",
"LayoutLMConfig",
}
for task, values in SUPPORTED_TASKS.items():
if values["type"] == "text":
NO_FEATURE_EXTRACTOR_TASKS.add(task)
Expand Down
14 changes: 3 additions & 11 deletions tests/pipelines/test_pipelines_object_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,9 @@ def test_layoutlm(self):
"https://huggingface.co/spaces/impira/docquery/resolve/2359223c1837a7587402bda0f2643382a6eefeab/invoice.png"
)
self.assertEqual(
nested_simplify(outputs, decimals=4),
nested_simplify(outputs, decimals=3),
[
{
"score": 0.9982,
"label": "B-QUESTION",
"box": {"xmin": 654, "ymin": 165, "xmax": 719, "ymax": 719},
},
{
"score": 0.9982,
"label": "I-QUESTION",
"box": {"xmin": 691, "ymin": 202, "xmax": 735, "ymax": 735},
},
{"score": 0.998, "label": "B-QUESTION", "box": {"xmin": 462, "ymin": 234, "xmax": 508, "ymax": 249}},
{"score": 0.999, "label": "I-QUESTION", "box": {"xmin": 489, "ymin": 286, "xmax": 519, "ymax": 301}},
],
)