teaevo commited on
Commit
42fd7c5
·
1 Parent(s): 59c5eff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -45,11 +45,9 @@ def predict(input, history=[]):
45
  if is_question:
46
  sql_encoding = sql_tokenizer(table=table, query=input + sql_tokenizer.eos_token, return_tensors="pt")
47
  sql_outputs = sql_model.generate(**sql_encoding)
48
- sql_response = sql_tokenizer.batch_decode(sql_outputs, skip_special_tokens=True)
49
 
50
- # Convert the SQL model's response to token IDs and add to the history
51
- sql_response_ids = tokenizer.encode(sql_response + tokenizer.eos_token, return_tensors='pt')
52
- history.extend(sql_response_ids.squeeze().tolist())
53
 
54
  '''
55
  bot_input_ids = torch.cat([torch.LongTensor(history), sql_encoding], dim=-1)
 
45
  if is_question:
46
  sql_encoding = sql_tokenizer(table=table, query=input + sql_tokenizer.eos_token, return_tensors="pt")
47
  sql_outputs = sql_model.generate(**sql_encoding)
48
+ response = sql_tokenizer.batch_decode(sql_outputs, skip_special_tokens=True)
49
 
50
+ history.append(response)
 
 
51
 
52
  '''
53
  bot_input_ids = torch.cat([torch.LongTensor(history), sql_encoding], dim=-1)