Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Aug 28, 2024
1 parent 26a4bf7 commit b427c67
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions vision_agent/utils/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,9 @@ def upload_file(self, file: Union[str, Path]) -> Path:
# Default behavior is a no-op (for local code interpreter)
return Path(file)

def download_file(self, remote_file_path: Union[str, Path], local_file_path: Union[str, Path]) -> Path:
def download_file(
self, remote_file_path: Union[str, Path], local_file_path: Union[str, Path]
) -> Path:
# Default behavior is a no-op (for local code interpreter)
return Path(local_file_path)

Expand Down Expand Up @@ -528,9 +530,13 @@ def upload_file(self, file: Union[str, Path]) -> Path:
_LOGGER.info(f"File ({file}) is uploaded to: {str(self.remote_path)}")
return self.remote_path

def download_file(self, remote_file_path: Union[str, Path], local_file_path: Union[str, Path]) -> Path:
def download_file(
self, remote_file_path: Union[str, Path], local_file_path: Union[str, Path]
) -> Path:
with open(local_file_path, "w+b") as f:
f.write(self.interpreter.files.read(path=str(remote_file_path), format="bytes"))
f.write(
self.interpreter.files.read(path=str(remote_file_path), format="bytes")
)
_LOGGER.info(f"File ({remote_file_path}) is downloaded to: {local_file_path}")
return Path(local_file_path)

Expand Down Expand Up @@ -625,7 +631,9 @@ def upload_file(self, file_path: Union[str, Path]) -> Path:

return Path(self.remote_path / file_path)

def download_file(self, remote_file_path: Union[str, Path], local_file_path: Union[str, Path]) -> Path:
def download_file(
self, remote_file_path: Union[str, Path], local_file_path: Union[str, Path]
) -> Path:
with open(self.remote_path / remote_file_path, "rb") as f:
contents = f.read()
with open(local_file_path, "wb") as f:
Expand Down

0 comments on commit b427c67

Please sign in to comment.