Changing model default for TableQuestionAnsweringPipeline. (#9729)
* Changing model default for TableQuestionAnsweringPipeline. - Discussion: https://discuss.huggingface.co/t/table-question-answering-is-not-an-available-task-under-pipeline/3284/6 * Updating slow tests that were out of sync.
This commit is contained in:
@@ -136,9 +136,9 @@ SUPPORTED_TASKS = {
|
|||||||
"tf": None,
|
"tf": None,
|
||||||
"default": {
|
"default": {
|
||||||
"model": {
|
"model": {
|
||||||
"pt": "nielsr/tapas-base-finetuned-wtq",
|
"pt": "google/tapas-base-finetuned-wtq",
|
||||||
"tokenizer": "nielsr/tapas-base-finetuned-wtq",
|
"tokenizer": "google/tapas-base-finetuned-wtq",
|
||||||
"tf": "nielsr/tapas-base-finetuned-wtq",
|
"tf": "google/tapas-base-finetuned-wtq",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class TQAPipelineTests(CustomInputPipelineCommonMixin, unittest.TestCase):
|
|||||||
"lysandre/tiny-tapas-random-wtq",
|
"lysandre/tiny-tapas-random-wtq",
|
||||||
"lysandre/tiny-tapas-random-sqa",
|
"lysandre/tiny-tapas-random-sqa",
|
||||||
]
|
]
|
||||||
large_models = ["nielsr/tapas-base-finetuned-wtq"] # Models tested with the @slow decorator
|
large_models = ["google/tapas-base-finetuned-wtq"] # Models tested with the @slow decorator
|
||||||
valid_inputs = [
|
valid_inputs = [
|
||||||
{
|
{
|
||||||
"table": {
|
"table": {
|
||||||
@@ -190,22 +190,25 @@ class TQAPipelineTests(CustomInputPipelineCommonMixin, unittest.TestCase):
|
|||||||
results = tqa_pipeline(data, queries)
|
results = tqa_pipeline(data, queries)
|
||||||
|
|
||||||
expected_results = [
|
expected_results = [
|
||||||
{"answer": "Transformers", "coordinates": [(0, 0)], "cells": ["Transformers"]},
|
{"answer": "Transformers", "coordinates": [(0, 0)], "cells": ["Transformers"], "aggregator": "NONE"},
|
||||||
{"answer": "Transformers", "coordinates": [(0, 0)], "cells": ["Transformers"]},
|
{"answer": "Transformers", "coordinates": [(0, 0)], "cells": ["Transformers"], "aggregator": "NONE"},
|
||||||
{
|
{
|
||||||
"answer": "Transformers, Datasets, Tokenizers",
|
"answer": "COUNT > Transformers, Datasets, Tokenizers",
|
||||||
"coordinates": [(0, 0), (1, 0), (2, 0)],
|
"coordinates": [(0, 0), (1, 0), (2, 0)],
|
||||||
"cells": ["Transformers", "Datasets", "Tokenizers"],
|
"cells": ["Transformers", "Datasets", "Tokenizers"],
|
||||||
|
"aggregator": "COUNT",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"answer": "36542, 4512, 3934",
|
"answer": "AVERAGE > 36542, 4512, 3934",
|
||||||
"coordinates": [(0, 1), (1, 1), (2, 1)],
|
"coordinates": [(0, 1), (1, 1), (2, 1)],
|
||||||
"cells": ["36542", "4512", "3934"],
|
"cells": ["36542", "4512", "3934"],
|
||||||
|
"aggregator": "AVERAGE",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"answer": "36542, 4512, 3934",
|
"answer": "SUM > 36542, 4512, 3934",
|
||||||
"coordinates": [(0, 1), (1, 1), (2, 1)],
|
"coordinates": [(0, 1), (1, 1), (2, 1)],
|
||||||
"cells": ["36542", "4512", "3934"],
|
"cells": ["36542", "4512", "3934"],
|
||||||
|
"aggregator": "SUM",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
self.assertListEqual(results, expected_results)
|
self.assertListEqual(results, expected_results)
|
||||||
@@ -214,8 +217,8 @@ class TQAPipelineTests(CustomInputPipelineCommonMixin, unittest.TestCase):
|
|||||||
def test_integration_sqa(self):
|
def test_integration_sqa(self):
|
||||||
tqa_pipeline = pipeline(
|
tqa_pipeline = pipeline(
|
||||||
"table-question-answering",
|
"table-question-answering",
|
||||||
model="nielsr/tapas-base-finetuned-sqa",
|
model="google/tapas-base-finetuned-sqa",
|
||||||
tokenizer="nielsr/tapas-base-finetuned-sqa",
|
tokenizer="google/tapas-base-finetuned-sqa",
|
||||||
)
|
)
|
||||||
data = {
|
data = {
|
||||||
"Actors": ["Brad Pitt", "Leonardo Di Caprio", "George Clooney"],
|
"Actors": ["Brad Pitt", "Leonardo Di Caprio", "George Clooney"],
|
||||||
|
|||||||
Reference in New Issue
Block a user