albhu commited on
Commit
543c187
·
verified ·
1 Parent(s): ae871b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -118,11 +118,14 @@ class InterestCalculatorApp:
118
  tokenized_row.append(self.tokenizer.tokenize(str(cell))) # Convert cell to string before tokenizing
119
  tokenized_table.append(tokenized_row)
120
 
 
 
 
121
  # Tokenize the query
122
  tokenized_query = self.tokenizer.tokenize(query)
123
 
124
  # Encode tokens and convert them to PyTorch tensors
125
- inputs = self.tokenizer(table=tokenized_table, query=tokenized_query, return_tensors="pt", padding=True)
126
 
127
  return inputs
128
 
 
118
  tokenized_row.append(self.tokenizer.tokenize(str(cell))) # Convert cell to string before tokenizing
119
  tokenized_table.append(tokenized_row)
120
 
121
+ # Create DataFrame from tokenized table
122
+ df_tokenized = pd.DataFrame(tokenized_table)
123
+
124
  # Tokenize the query
125
  tokenized_query = self.tokenizer.tokenize(query)
126
 
127
  # Encode tokens and convert them to PyTorch tensors
128
+ inputs = self.tokenizer(table=df_tokenized, query=tokenized_query, return_tensors="pt", padding=True)
129
 
130
  return inputs
131