Update app.py
Browse files
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 |
-
|
49 |
|
50 |
-
|
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)
|