Spaces:
Sleeping
Sleeping
Commit ·
fb0cae8
1
Parent(s): cb5a5c0
updated core_logic
Browse files
app.py
CHANGED
|
@@ -162,10 +162,18 @@ with gr.Blocks() as demo:
|
|
| 162 |
history.append({"role": "user", "content": user_content})
|
| 163 |
history.append({"role": "assistant", "content": ""})
|
| 164 |
|
| 165 |
-
for partial_resp in chat_function(message, clean_history_snapshot):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
history[-1]["content"] = partial_resp
|
| 167 |
yield history
|
| 168 |
|
|
|
|
| 169 |
"""
|
| 170 |
def handle_save(history, chat_id, session_password):
|
| 171 |
new_id = save_chat(chat_id, history)
|
|
|
|
| 162 |
history.append({"role": "user", "content": user_content})
|
| 163 |
history.append({"role": "assistant", "content": ""})
|
| 164 |
|
| 165 |
+
#for partial_resp in chat_function(message, clean_history_snapshot):
|
| 166 |
+
# history[-1]["content"] = partial_resp
|
| 167 |
+
# yield history
|
| 168 |
+
|
| 169 |
+
# --- Import and pass client & model down to the function ---
|
| 170 |
+
from core_logic import client, model # Adjust this import statement based on where your global client instance lives
|
| 171 |
+
|
| 172 |
+
for partial_resp in chat_function(message, clean_history_snapshot, client, model):
|
| 173 |
history[-1]["content"] = partial_resp
|
| 174 |
yield history
|
| 175 |
|
| 176 |
+
|
| 177 |
"""
|
| 178 |
def handle_save(history, chat_id, session_password):
|
| 179 |
new_id = save_chat(chat_id, history)
|