lvwerra HF staff commited on
Commit
5c34853
·
verified ·
1 Parent(s): db522f8

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +6 -1
utils.py CHANGED
@@ -10,6 +10,10 @@ config = Config()
10
  html_exporter = HTMLExporter(config=config, template_name="classic")
11
 
12
 
 
 
 
 
13
  def parse_exec_result_nb(execution):
14
  """Convert an E2B Execution object to Jupyter notebook cell output format"""
15
  outputs = []
@@ -219,7 +223,8 @@ def run_interactive_notebook(client, model, tokenizer, messages, sbx, max_new_to
219
  #code_cell_counter = 0
220
  while True:
221
  input_tokens = tokenizer.apply_chat_template(
222
- messages,
 
223
  builtin_tools=["code_interpreter"],
224
  add_generation_prompt=True
225
  )
 
10
  html_exporter = HTMLExporter(config=config, template_name="classic")
11
 
12
 
13
+ with open("llama3_template.jinja", "r") as f:
14
+ llama_template = f.read()
15
+
16
+
17
  def parse_exec_result_nb(execution):
18
  """Convert an E2B Execution object to Jupyter notebook cell output format"""
19
  outputs = []
 
223
  #code_cell_counter = 0
224
  while True:
225
  input_tokens = tokenizer.apply_chat_template(
226
+ messages,
227
+ template=llama_template,
228
  builtin_tools=["code_interpreter"],
229
  add_generation_prompt=True
230
  )