lvwerra HF staff commited on
Commit
e9163a2
·
verified ·
1 Parent(s): c931099

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +11 -0
utils.py CHANGED
@@ -106,6 +106,17 @@ def create_base_notebook(messages):
106
  "metadata": {},
107
  "source": header_message
108
  })
 
 
 
 
 
 
 
 
 
 
 
109
  for message in messages:
110
  if message["role"] == "system":
111
  text = system_template.format(message["content"].replace('\n', '<br>'))
 
106
  "metadata": {},
107
  "source": header_message
108
  })
109
+
110
+ if len(messages)==0:
111
+ base_notebook["cells"].append({
112
+ "cell_type": "code",
113
+ "execution_count": None,
114
+ "metadata": {},
115
+ "source": "",
116
+ "outputs": []
117
+ })
118
+
119
+
120
  for message in messages:
121
  if message["role"] == "system":
122
  text = system_template.format(message["content"].replace('\n', '<br>'))