Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,14 +34,17 @@ def execute_jupyter_agent(sytem_prompt, user_input, max_new_tokens):
|
|
| 34 |
model = "meta-llama/Llama-3.1-8B-Instruct"
|
| 35 |
|
| 36 |
sbx = Sandbox(api_key=E2B_API_KEY)
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
message_history
|
|
|
|
|
|
|
|
|
|
| 45 |
yield notebook_html
|
| 46 |
|
| 47 |
|
|
|
|
| 34 |
model = "meta-llama/Llama-3.1-8B-Instruct"
|
| 35 |
|
| 36 |
sbx = Sandbox(api_key=E2B_API_KEY)
|
| 37 |
+
|
| 38 |
+
if message_history = None:
|
| 39 |
+
message_history = [
|
| 40 |
+
{"role": "system", "content": sytem_prompt},
|
| 41 |
+
{"role": "user", "content": user_input}
|
| 42 |
+
]
|
| 43 |
+
else:
|
| 44 |
+
message_history.append({"role": "user", "content": user_input})
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
for notebook_html, message_history in run_interactive_notebook(client, model, messages, sbx, max_new_tokens=max_new_tokens):
|
| 48 |
yield notebook_html
|
| 49 |
|
| 50 |
|