Spaces:
Running
Running
Rename app/tapas.py to app/tapex.py
Browse files
app/{tapas.py β tapex.py}
RENAMED
@@ -1,6 +1,7 @@
|
|
1 |
from transformers import TapasTokenizer, TapexTokenizer, BartForConditionalGeneration
|
2 |
import pandas as pd
|
3 |
import datetime
|
|
|
4 |
|
5 |
|
6 |
def execute_query(query, csv_file):
|
@@ -16,7 +17,7 @@ def execute_query(query, csv_file):
|
|
16 |
|
17 |
queries = [query]
|
18 |
|
19 |
-
encoding = tokenizer(table=table, queries=queries, padding=True, return_tensors="
|
20 |
outputs = model.generate(**encoding)
|
21 |
ans = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
22 |
|
|
|
1 |
from transformers import TapasTokenizer, TapexTokenizer, BartForConditionalGeneration
|
2 |
import pandas as pd
|
3 |
import datetime
|
4 |
+
import torch
|
5 |
|
6 |
|
7 |
def execute_query(query, csv_file):
|
|
|
17 |
|
18 |
queries = [query]
|
19 |
|
20 |
+
encoding = tokenizer(table=table, queries=queries, padding=True, return_tensors="pt",truncated=True)
|
21 |
outputs = model.generate(**encoding)
|
22 |
ans = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
23 |
|