You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there is a nice protection against infinite loops in the local python interpreter, but unfortunately, it doesn't work if an agent creates a double loop with a second loop in a function.
Code to reproduce the error
Here is an example of a correct interruption at 10000000 operations:
inter=smolagents.LocalPythonExecutor(additional_authorized_imports=[])
inter.send_tools({})
code="""a = 0for i in range(10_000): for j in range(10_000): a += i+j"""inter(code)
And the following code proceeds till the end:
inter=smolagents.LocalPythonExecutor(additional_authorized_imports=[])
inter.send_tools({})
code="""a = 0def foo(a,i): for j in range(10_000): a += i+j return afor i in range(10_000): a = foo(a,i)"""inter(code)
Expected behavior
Expected InterpreterError: Reached the max number of operations of 10000000. Maybe there is an infinite loop somewhere in the code, or you're just asking too many calculations. in the second case as well.
Packages version:
Affected main
The text was updated successfully, but these errors were encountered:
Hello,
there is a nice protection against infinite loops in the local python interpreter, but unfortunately, it doesn't work if an agent creates a double loop with a second loop in a function.
Code to reproduce the error
Here is an example of a correct interruption at 10000000 operations:
And the following code proceeds till the end:
Expected behavior
Expected
InterpreterError: Reached the max number of operations of 10000000. Maybe there is an infinite loop somewhere in the code, or you're just asking too many calculations.
in the second case as well.Packages version:
Affected
main
The text was updated successfully, but these errors were encountered: