Spaces:
Running
Running
Update utils.py
Browse files
utils.py
CHANGED
@@ -106,6 +106,11 @@ header_message = """<p align="center">
|
|
106 |
|
107 |
<p style="text-align:center;">Let a LLM agent write and execute code inside a notebook!</p>"""
|
108 |
|
|
|
|
|
|
|
|
|
|
|
109 |
def create_base_notebook(messages):
|
110 |
base_notebook = {
|
111 |
"metadata": {
|
@@ -204,6 +209,7 @@ def parse_exec_result_llm(execution):
|
|
204 |
def update_notebook_display(notebook_data):
|
205 |
notebook = nbformat.from_dict(notebook_data)
|
206 |
notebook_body, _ = html_exporter.from_notebook_node(notebook)
|
|
|
207 |
return notebook_body
|
208 |
|
209 |
def run_interactive_notebook(client, model, tokenizer, messages, sbx, max_new_tokens=512):
|
|
|
106 |
|
107 |
<p style="text-align:center;">Let a LLM agent write and execute code inside a notebook!</p>"""
|
108 |
|
109 |
+
bad_html_bad = """input[type="file"] {
|
110 |
+
display: block;
|
111 |
+
}"""
|
112 |
+
|
113 |
+
|
114 |
def create_base_notebook(messages):
|
115 |
base_notebook = {
|
116 |
"metadata": {
|
|
|
209 |
def update_notebook_display(notebook_data):
|
210 |
notebook = nbformat.from_dict(notebook_data)
|
211 |
notebook_body, _ = html_exporter.from_notebook_node(notebook)
|
212 |
+
notebook_body = notebook_body.replace(bad_html_bad, "")
|
213 |
return notebook_body
|
214 |
|
215 |
def run_interactive_notebook(client, model, tokenizer, messages, sbx, max_new_tokens=512):
|