Update app.py
Browse files
app.py
CHANGED
@@ -65,6 +65,8 @@ data["city"] = [random.choice(cities) for _ in range(num_records)]
|
|
65 |
|
66 |
table = pd.DataFrame(data)
|
67 |
'''
|
|
|
|
|
68 |
|
69 |
data = {
|
70 |
"year": [1896, 1900, 1904, 2004, 2008, 2012],
|
@@ -128,8 +130,8 @@ def sqlquery(input): #, history=[]):
|
|
128 |
|
129 |
global conversation_history
|
130 |
|
131 |
-
|
132 |
-
sql_encoding = sql_tokenizer(table=table, query=input
|
133 |
sql_outputs = sql_model.generate(**sql_encoding)
|
134 |
sql_response = sql_tokenizer.batch_decode(sql_outputs, skip_special_tokens=True)
|
135 |
|
|
|
65 |
|
66 |
table = pd.DataFrame(data)
|
67 |
'''
|
68 |
+
#table = pd.read_csv(csv_file.name, delimiter=",")
|
69 |
+
#table = table.astype(str)
|
70 |
|
71 |
data = {
|
72 |
"year": [1896, 1900, 1904, 2004, 2008, 2012],
|
|
|
130 |
|
131 |
global conversation_history
|
132 |
|
133 |
+
inputs = [input]
|
134 |
+
sql_encoding = sql_tokenizer(table=table, query=input, return_tensors="pt")
|
135 |
sql_outputs = sql_model.generate(**sql_encoding)
|
136 |
sql_response = sql_tokenizer.batch_decode(sql_outputs, skip_special_tokens=True)
|
137 |
|