Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
humpydonkey committed Jun 3, 2024
1 parent 8087d8a commit c1ac4e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vision_agent/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def overlay_heat_map(
pil_image = Image.fromarray(image.astype(np.uint8)).convert("RGB")

if "heat_map" not in heat_map or len(heat_map["heat_map"]) == 0:
return image
return pil_image

pil_image = pil_image.convert("L")
mask = Image.fromarray(heat_map["heat_map"])
Expand Down
5 changes: 3 additions & 2 deletions vision_agent/utils/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import sys
import tempfile
import traceback
import warnings
from enum import Enum
from io import IOBase
from pathlib import Path
Expand Down Expand Up @@ -506,9 +507,9 @@ class CodeInterpreterFactory:
_instance_map: Dict[str, CodeInterpreter] = {}
_default_key = "default"

@DeprecationWarning("Use new_instance() instead for production usage, get_default_instance() is for testing and will be removed in the future.")
@staticmethod
def get_default_instance() -> CodeInterpreter:
warnings.warn("Use new_instance() instead for production usage, get_default_instance() is for testing and will be removed in the future.")
inst_map = CodeInterpreterFactory._instance_map
instance = inst_map.get(CodeInterpreterFactory._default_key)
if instance:
Expand All @@ -520,7 +521,7 @@ def get_default_instance() -> CodeInterpreter:
@staticmethod
def new_instance() -> CodeInterpreter:
if os.getenv("CODE_SANDBOX_RUNTIME") == "e2b":
instance = E2BCodeInterpreter(timeout=600)
instance: CodeInterpreter = E2BCodeInterpreter(timeout=600)
else:
instance = LocalCodeInterpreter(timeout=600)
atexit.register(instance.close)
Expand Down

0 comments on commit c1ac4e2

Please sign in to comment.