AutoGPT: Fix artifact upload

This commit is contained in:
Reinier van der Leer
2023-10-17 15:50:55 -07:00
parent fac52a6bc6
commit 8adfca5fb7

View File

@@ -67,7 +67,7 @@ class FileWorkspace:
def write_file(self, path: str | Path, content: str | bytes):
"""Write to a file in the workspace."""
with self.open_file(path, "w") as file:
with self.open_file(path, "wb" if type(content) is bytes else "w") as file:
file.write(content)
if self.on_write_file: