lvwerra HF staff commited on
Commit
926febf
·
verified ·
1 Parent(s): b5a423e

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +2 -2
utils.py CHANGED
@@ -142,7 +142,7 @@ def create_base_notebook(messages):
142
  "source": text
143
  })
144
 
145
- elif message["role"] == "assistant" and "tool_call" in message:
146
  base_notebook["cells"].append({
147
  "cell_type": "code",
148
  "execution_count": None,
@@ -156,7 +156,7 @@ def create_base_notebook(messages):
156
  base_notebook["cells"][-1]["outputs"].append(message["content"])
157
  base_notebook["cells"][-1]["execution_count"] = code_cell_counter
158
 
159
- elif message["role"] == "assistant" and "tool_call" not in message:
160
  base_notebook["cells"].append({
161
  "cell_type": "markdown",
162
  "metadata": {},
 
142
  "source": text
143
  })
144
 
145
+ elif message["role"] == "assistant" and "tool_calls" in message:
146
  base_notebook["cells"].append({
147
  "cell_type": "code",
148
  "execution_count": None,
 
156
  base_notebook["cells"][-1]["outputs"].append(message["content"])
157
  base_notebook["cells"][-1]["execution_count"] = code_cell_counter
158
 
159
+ elif message["role"] == "assistant" and "tool_calls" not in message:
160
  base_notebook["cells"].append({
161
  "cell_type": "markdown",
162
  "metadata": {},