themissingCRAM
commited on
Commit
·
e23a574
1
Parent(s):
7ded5fa
level 2
Browse files
app.py
CHANGED
@@ -98,6 +98,22 @@ def init_db(engine):
|
|
98 |
]
|
99 |
insert_rows_into_table(rows, receipts)
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
return engine
|
102 |
|
103 |
|
@@ -105,7 +121,8 @@ if __name__ == "__main__":
|
|
105 |
engine = create_engine("sqlite:///:localhost:")
|
106 |
engine = init_db(engine)
|
107 |
model = HfApiModel(
|
108 |
-
model_id="
|
|
|
109 |
token=os.getenv("my_first_agents_hf_tokens"),
|
110 |
)
|
111 |
|
@@ -125,7 +142,7 @@ if __name__ == "__main__":
|
|
125 |
|
126 |
with gr.Blocks() as b:
|
127 |
chatbot = gr.Chatbot(type="messages", height=1000)
|
128 |
-
textbox = gr.Textbox(lines=3)
|
129 |
button = gr.Button("reply")
|
130 |
button.click(enter_message, [textbox, chatbot], [textbox, chatbot])
|
131 |
b.launch()
|
|
|
98 |
]
|
99 |
insert_rows_into_table(rows, receipts)
|
100 |
|
101 |
+
table_name = "waiters"
|
102 |
+
waiters = Table(
|
103 |
+
table_name,
|
104 |
+
metadata_obj,
|
105 |
+
Column("receipt_id", Integer, primary_key=True),
|
106 |
+
Column("waiter_name", String(16), primary_key=True),
|
107 |
+
)
|
108 |
+
metadata_obj.create_all(engine)
|
109 |
+
|
110 |
+
rows = [
|
111 |
+
{"receipt_id": 1, "waiter_name": "Corey Johnson"},
|
112 |
+
{"receipt_id": 2, "waiter_name": "Michael Watts"},
|
113 |
+
{"receipt_id": 3, "waiter_name": "Michael Watts"},
|
114 |
+
{"receipt_id": 4, "waiter_name": "Margaret James"},
|
115 |
+
]
|
116 |
+
insert_rows_into_table(rows, waiters)
|
117 |
return engine
|
118 |
|
119 |
|
|
|
121 |
engine = create_engine("sqlite:///:localhost:")
|
122 |
engine = init_db(engine)
|
123 |
model = HfApiModel(
|
124 |
+
model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
125 |
+
# model_id="meta-llama/Meta-Llama-3.1-8B-Instruct",
|
126 |
token=os.getenv("my_first_agents_hf_tokens"),
|
127 |
)
|
128 |
|
|
|
142 |
|
143 |
with gr.Blocks() as b:
|
144 |
chatbot = gr.Chatbot(type="messages", height=1000)
|
145 |
+
textbox = gr.Textbox(lines=3, label="")
|
146 |
button = gr.Button("reply")
|
147 |
button.click(enter_message, [textbox, chatbot], [textbox, chatbot])
|
148 |
b.launch()
|