70
70
ImageToImageTargetSize ,
71
71
ImageToTextOutput ,
72
72
ObjectDetectionOutputElement ,
73
+ Padding ,
73
74
QuestionAnsweringOutputElement ,
74
75
SummarizationOutput ,
75
76
SummarizationTruncationStrategy ,
@@ -1713,7 +1714,9 @@ async def table_question_answering(
1713
1714
query : str ,
1714
1715
* ,
1715
1716
model : Optional [str ] = None ,
1716
- parameters : Optional [Dict [str , Any ]] = None ,
1717
+ padding : Optional ["Padding" ] = None ,
1718
+ sequential : Optional [bool ] = None ,
1719
+ truncation : Optional [bool ] = None ,
1717
1720
) -> TableQuestionAnsweringOutputElement :
1718
1721
"""
1719
1722
Retrieve the answer to a question from information given in a table.
@@ -1727,8 +1730,14 @@ async def table_question_answering(
1727
1730
model (`str`):
1728
1731
The model to use for the table-question-answering task. Can be a model ID hosted on the Hugging Face
1729
1732
Hub or a URL to a deployed Inference Endpoint.
1730
- parameters (`Dict[str, Any]`, *optional*):
1731
- Additional inference parameters. Defaults to None.
1733
+ padding (`"Padding"`, *optional*):
1734
+ Activates and controls padding.
1735
+ sequential (`bool`, *optional*):
1736
+ Whether to do inference sequentially or as a batch. Batching is faster, but models like SQA require the
1737
+ inference to be done sequentially to extract relations within sequences, given their conversational
1738
+ nature.
1739
+ truncation (`bool`, *optional*):
1740
+ Activates and controls truncation.
1732
1741
1733
1742
Returns:
1734
1743
[`TableQuestionAnsweringOutputElement`]: a table question answering output containing the answer, coordinates, cells and the aggregator used.
@@ -1750,6 +1759,11 @@ async def table_question_answering(
1750
1759
TableQuestionAnsweringOutputElement(answer='36542', coordinates=[[0, 1]], cells=['36542'], aggregator='AVERAGE')
1751
1760
```
1752
1761
"""
1762
+ parameters = {
1763
+ "padding" : padding ,
1764
+ "sequential" : sequential ,
1765
+ "truncation" : truncation ,
1766
+ }
1753
1767
inputs = {
1754
1768
"query" : query ,
1755
1769
"table" : table ,
0 commit comments