themissingCRAM
commited on
Commit
·
97413fe
1
Parent(s):
4bb3808
switch to llama llm 3
Browse files
app.py
CHANGED
@@ -19,7 +19,6 @@ import spaces
|
|
19 |
|
20 |
from dotenv import load_dotenv
|
21 |
|
22 |
-
engine = create_engine("sqlite:///:memory:")
|
23 |
load_dotenv()
|
24 |
|
25 |
# What is the average each customer paid? Create a sql statement and invoke your sql_engine tool
|
@@ -55,7 +54,7 @@ def sql_engine_tool(
|
|
55 |
return output
|
56 |
|
57 |
|
58 |
-
def init_db():
|
59 |
|
60 |
metadata_obj = MetaData()
|
61 |
|
@@ -95,10 +94,12 @@ def init_db():
|
|
95 |
insert_rows_into_table(rows, receipts)
|
96 |
with engine.begin() as conn:
|
97 |
print("SELECT test", conn.execute(text("SELECT * FROM receipts")).fetchall())
|
|
|
98 |
|
99 |
|
100 |
if __name__ == "__main__":
|
101 |
-
|
|
|
102 |
model = HfApiModel(
|
103 |
model_id="",
|
104 |
token=os.getenv("my_first_agents_hf_tokens"),
|
|
|
19 |
|
20 |
from dotenv import load_dotenv
|
21 |
|
|
|
22 |
load_dotenv()
|
23 |
|
24 |
# What is the average each customer paid? Create a sql statement and invoke your sql_engine tool
|
|
|
54 |
return output
|
55 |
|
56 |
|
57 |
+
def init_db(engine):
|
58 |
|
59 |
metadata_obj = MetaData()
|
60 |
|
|
|
94 |
insert_rows_into_table(rows, receipts)
|
95 |
with engine.begin() as conn:
|
96 |
print("SELECT test", conn.execute(text("SELECT * FROM receipts")).fetchall())
|
97 |
+
return engine
|
98 |
|
99 |
|
100 |
if __name__ == "__main__":
|
101 |
+
engine = create_engine("sqlite:///:memory:")
|
102 |
+
engine = init_db(engine)
|
103 |
model = HfApiModel(
|
104 |
model_id="",
|
105 |
token=os.getenv("my_first_agents_hf_tokens"),
|