Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

AutoGPT: Fix artifact upload

Reinier van der Leer8adfca5fb7e9
diff --git a/autogpts/autogpt/autogpt/file_workspace/file_workspace.py b/autogpts/autogpt/autogpt/file_workspace/file_workspace.py
index f4f572b7ae..7fe918b6e4 100644
--- a/autogpts/autogpt/autogpt/file_workspace/file_workspace.py
+++ b/autogpts/autogpt/autogpt/file_workspace/file_workspace.py
@@ -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: