themissingCRAM
commited on
Commit
·
3d2d75d
1
Parent(s):
e313ba6
checking tables
Browse files
app.py
CHANGED
@@ -60,8 +60,7 @@ def init_db():
|
|
60 |
for row in rows:
|
61 |
stmt = insert(table).values(**row)
|
62 |
with engine.begin() as connection:
|
63 |
-
|
64 |
-
print(r)
|
65 |
|
66 |
table_name = "receipts"
|
67 |
receipts = Table(
|
@@ -91,24 +90,24 @@ def init_db():
|
|
91 |
},
|
92 |
]
|
93 |
insert_rows_into_table(rows, receipts)
|
94 |
-
|
95 |
-
|
96 |
|
97 |
|
98 |
if __name__ == "__main__":
|
99 |
init_db()
|
100 |
-
model = HfApiModel(
|
101 |
-
|
102 |
-
|
103 |
-
)
|
104 |
-
|
105 |
-
agent = CodeAgent(
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
)
|
114 |
-
GradioUI(agent).launch()
|
|
|
60 |
for row in rows:
|
61 |
stmt = insert(table).values(**row)
|
62 |
with engine.begin() as connection:
|
63 |
+
connection.execute(stmt)
|
|
|
64 |
|
65 |
table_name = "receipts"
|
66 |
receipts = Table(
|
|
|
90 |
},
|
91 |
]
|
92 |
insert_rows_into_table(rows, receipts)
|
93 |
+
with engine.begin() as conn:
|
94 |
+
print("SELECT test", conn.execute(text("SELECT * FROM recipts")).fetchall())
|
95 |
|
96 |
|
97 |
if __name__ == "__main__":
|
98 |
init_db()
|
99 |
+
# model = HfApiModel(
|
100 |
+
# model_id="HuggingFaceH4/zephyr-7b-beta",
|
101 |
+
# token=os.getenv("my_first_agents_hf_tokens"),
|
102 |
+
# )
|
103 |
+
|
104 |
+
# agent = CodeAgent(
|
105 |
+
# tools=[sql_engine_tool],
|
106 |
+
# # system_prompt="""
|
107 |
+
# # You are a text to sql converter
|
108 |
+
# # """,
|
109 |
+
# model=model,
|
110 |
+
# max_steps=1,
|
111 |
+
# verbosity_level=1,
|
112 |
+
# )
|
113 |
+
# GradioUI(agent).launch()
|