Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase max_tokens, strip extra chars for error messages #159

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions vision_agent/lmm/lmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(
self,
model_name: str = "gpt-4o",
api_key: Optional[str] = None,
max_tokens: int = 1024,
max_tokens: int = 4096,
json_mode: bool = False,
**kwargs: Any,
):
Expand Down Expand Up @@ -241,7 +241,7 @@ def __init__(
api_key: Optional[str] = None,
api_version: str = "2024-02-01",
azure_endpoint: Optional[str] = None,
max_tokens: int = 1024,
max_tokens: int = 4096,
json_mode: bool = False,
**kwargs: Any,
):
Expand Down
13 changes: 9 additions & 4 deletions vision_agent/utils/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,10 @@ def from_exception(exec: Exception, traceback_raw: List[str]) -> "Execution":
return Execution(
error=Error(
name=exec.__class__.__name__,
value=str(exec),
traceback_raw=traceback_raw,
value=_remove_escape_and_color_codes(str(exec)),
traceback_raw=[
_remove_escape_and_color_codes(e) for e in traceback_raw
],
)
)

Expand All @@ -369,8 +371,11 @@ def from_e2b_execution(exec: E2BExecution) -> "Execution": # type: ignore
error=(
Error(
name=exec.error.name,
value=exec.error.value,
traceback_raw=exec.error.traceback_raw,
value=_remove_escape_and_color_codes(exec.error.value),
traceback_raw=[
_remove_escape_and_color_codes(e)
for e in exec.error.traceback_raw
],
)
if exec.error
else None
Expand Down
Loading