Skip to content

Commit 7335260

Browse files
Fixes bug no attribute 'logger'
huggingface#258
1 parent cdfbde5 commit 7335260

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/smolagents/agents.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -907,13 +907,6 @@ def __init__(
907907
raise AgentError(
908908
"Tag '{{authorized_imports}}' should be provided in the prompt."
909909
)
910-
911-
if "*" in self.additional_authorized_imports:
912-
self.logger.log(
913-
"Caution: you set an authorization for all imports, meaning your agent can decide to import any package it deems necessary. This might raise issues if the package is not installed in your environment.",
914-
0,
915-
)
916-
917910
super().__init__(
918911
tools=tools,
919912
model=model,
@@ -922,6 +915,12 @@ def __init__(
922915
planning_interval=planning_interval,
923916
**kwargs,
924917
)
918+
if "*" in self.additional_authorized_imports:
919+
self.logger.log(
920+
"Caution: you set an authorization for all imports, meaning your agent can decide to import any package it deems necessary. This might raise issues if the package is not installed in your environment.",
921+
0,
922+
)
923+
925924
if use_e2b_executor and len(self.managed_agents) > 0:
926925
raise Exception(
927926
f"You passed both {use_e2b_executor=} and some managed agents. Managed agents is not yet supported with remote code execution."

0 commit comments

Comments
 (0)