themissingCRAM
commited on
Commit
·
a37048e
1
Parent(s):
0f79c22
blocks experiment
Browse files- app.py +5 -6
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -118,7 +118,8 @@ def init_db(engine):
|
|
| 118 |
|
| 119 |
|
| 120 |
if __name__ == "__main__":
|
| 121 |
-
|
|
|
|
| 122 |
model = HfApiModel(
|
| 123 |
model_id="meta-llama/Meta-Llama-3.1-8B-Instruct",
|
| 124 |
token=os.getenv("my_first_agents_hf_tokens"),
|
|
@@ -135,9 +136,9 @@ if __name__ == "__main__":
|
|
| 135 |
)
|
| 136 |
# agent.run("What is the average each customer paid?")
|
| 137 |
# GradioUI(agent).launch()
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
|
| 142 |
def enter_message(message, chat_history):
|
| 143 |
print()
|
|
@@ -152,8 +153,6 @@ if __name__ == "__main__":
|
|
| 152 |
return "", x
|
| 153 |
|
| 154 |
with gr.Blocks() as b:
|
| 155 |
-
engine = create_engine("sqlite:///:memory:")
|
| 156 |
-
engine, metadata_objects = init_db(engine)
|
| 157 |
chatbot = gr.Chatbot(type="messages")
|
| 158 |
input = gr.Textbox()
|
| 159 |
button = gr.Button("reply")
|
|
|
|
| 118 |
|
| 119 |
|
| 120 |
if __name__ == "__main__":
|
| 121 |
+
engine = create_engine("sqlite:///:memory:")
|
| 122 |
+
engine, metadata_objects = init_db(engine)
|
| 123 |
model = HfApiModel(
|
| 124 |
model_id="meta-llama/Meta-Llama-3.1-8B-Instruct",
|
| 125 |
token=os.getenv("my_first_agents_hf_tokens"),
|
|
|
|
| 136 |
)
|
| 137 |
# agent.run("What is the average each customer paid?")
|
| 138 |
# GradioUI(agent).launch()
|
| 139 |
+
print(
|
| 140 |
+
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx test:", sql_engine_tool("SELECT * FROM receipts")
|
| 141 |
+
)
|
| 142 |
|
| 143 |
def enter_message(message, chat_history):
|
| 144 |
print()
|
|
|
|
| 153 |
return "", x
|
| 154 |
|
| 155 |
with gr.Blocks() as b:
|
|
|
|
|
|
|
| 156 |
chatbot = gr.Chatbot(type="messages")
|
| 157 |
input = gr.Textbox()
|
| 158 |
button = gr.Button("reply")
|
requirements.txt
CHANGED
|
@@ -3,4 +3,5 @@ smolagents>=1.12.0
|
|
| 3 |
python-dotenv==1.1.0
|
| 4 |
sqlalchemy==2.0.40
|
| 5 |
gradio>=5.23.1
|
| 6 |
-
spaces>0.0.0
|
|
|
|
|
|
| 3 |
python-dotenv==1.1.0
|
| 4 |
sqlalchemy==2.0.40
|
| 5 |
gradio>=5.23.1
|
| 6 |
+
spaces>0.0.0
|
| 7 |
+
sqlite3>3.13.2
|