lvwerra HF staff commited on
Commit
4c74a4e
·
verified ·
1 Parent(s): 401ca9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -40,13 +40,13 @@ def execute_jupyter_agent(sytem_prompt, user_input, max_new_tokens, model,files,
40
  sbx = Sandbox(api_key=E2B_API_KEY)
41
 
42
  filenames = []
43
-
44
- for filepath in files:
45
- filpath = Path(filepath)
46
- with open(filepath, "rb") as file:
47
- print(f"uploading {filepath}...")
48
- sbx.files.write(filpath.name, file)
49
- filenames.append(filpath.name)
50
 
51
 
52
 
 
40
  sbx = Sandbox(api_key=E2B_API_KEY)
41
 
42
  filenames = []
43
+ if files is not None:
44
+ for filepath in files:
45
+ filpath = Path(filepath)
46
+ with open(filepath, "rb") as file:
47
+ print(f"uploading {filepath}...")
48
+ sbx.files.write(filpath.name, file)
49
+ filenames.append(filpath.name)
50
 
51
 
52