patrawtf commited on
Commit
3720e70
β€’
1 Parent(s): 94ee912

Rename app/tapas.py to app/tapex.py

Browse files
Files changed (1) hide show
  1. app/{tapas.py β†’ tapex.py} +2 -1
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="tf",truncated=True)
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