themissingCRAM commited on
Commit
3d2d75d
·
1 Parent(s): e313ba6

checking tables

Browse files
Files changed (1) hide show
  1. app.py +18 -19
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
- r = connection.execute(stmt).mappings().all()
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
- # with engine.begin() as conn:
95
- # print("SELECT test", conn.execute(select("receipts")))
96
 
97
 
98
  if __name__ == "__main__":
99
  init_db()
100
- model = HfApiModel(
101
- model_id="HuggingFaceH4/zephyr-7b-beta",
102
- token=os.getenv("my_first_agents_hf_tokens"),
103
- )
104
-
105
- agent = CodeAgent(
106
- tools=[sql_engine_tool],
107
- # system_prompt="""
108
- # You are a text to sql converter
109
- # """,
110
- model=model,
111
- max_steps=1,
112
- verbosity_level=1,
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()