Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
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 |
|