lvwerra HF staff commited on
Commit
55dbaf1
·
verified ·
1 Parent(s): c444169

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -30,6 +30,10 @@ TMP_DIR = './tmp/'
30
  if not os.path.exists(TMP_DIR):
31
  os.makedirs(TMP_DIR)
32
 
 
 
 
 
33
  with open("ds-system-prompt.txt", "r") as f:
34
  DEFAULT_SYSTEM_PROMPT = f.read()
35
 
@@ -109,7 +113,7 @@ with gr.Blocks() as demo:
109
  msg_state = gr.State(value=[])
110
 
111
  html_output = gr.HTML(value=update_notebook_display(create_base_notebook([])[0]))
112
- file = gr.File()
113
  user_input = gr.Textbox(
114
  value="Solve the Lotka-Volterra equation and plot the results.", lines=3
115
  )
 
30
  if not os.path.exists(TMP_DIR):
31
  os.makedirs(TMP_DIR)
32
 
33
+ notebook_data = create_base_notebook([])[0]
34
+ with open(TMP_DIR+"jupyter-agent.ipynb", 'w', encoding='utf-8') as f:
35
+ json.dump(notebook_data, f, indent=2)
36
+
37
  with open("ds-system-prompt.txt", "r") as f:
38
  DEFAULT_SYSTEM_PROMPT = f.read()
39
 
 
113
  msg_state = gr.State(value=[])
114
 
115
  html_output = gr.HTML(value=update_notebook_display(create_base_notebook([])[0]))
116
+ file = gr.File(TMP_DIR+"jupyter-agent.ipynb")
117
  user_input = gr.Textbox(
118
  value="Solve the Lotka-Volterra equation and plot the results.", lines=3
119
  )