Skip to content

Commit cc49cb6

Browse files
threewebcodegarrett361
authored andcommitted
chore: fix message descriptions in arguments and comments (huggingface#36504)
chore: fix messagedescriptions in arguments and comments
1 parent 7e31d9d commit cc49cb6

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/transformers/agents/agents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def format_prompt_with_tools(toolbox: Toolbox, prompt_template: str, tool_descri
332332
def show_agents_descriptions(managed_agents: list):
333333
managed_agents_descriptions = """
334334
You can also give requests to team members.
335-
Calling a team member works the same as for calling a tool: simply, the only argument you can give in the call is 'request', a long string explaning your request.
335+
Calling a team member works the same as for calling a tool: simply, the only argument you can give in the call is 'request', a long string explaining your request.
336336
Given that this team member is a real human, you should be very verbose in your request.
337337
Here is a list of the team members that you can call:"""
338338
for agent in managed_agents.values():

src/transformers/agents/evaluate_agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def score_code(agent_answer, theoretical_answer, verbose: bool = False):
275275
return 1
276276
elif isinstance(agent_answer, dict) and any(v in theoretical_answer for v in agent_answer.values()):
277277
if verbose:
278-
print("Almsot perfect, result in state!")
278+
print("Almost perfect, result in state!")
279279
return 0.75
280280
else:
281281
if verbose:
@@ -345,7 +345,7 @@ def evaluate_agent(agent, batch_size=8, verbose=False, return_errors=False):
345345
missing_tools = set(TEST_TOOLS) - agent_tools
346346
unexpected_tools = set(agent_tools) - TEST_TOOLS
347347
raise ValueError(
348-
f"Fix the test tools in the evaluate_agent module. Tools mising: {missing_tools}. Extra tools: {unexpected_tools}."
348+
f"Fix the test tools in the evaluate_agent module. Tools missing: {missing_tools}. Extra tools: {unexpected_tools}."
349349
)
350350

351351
eval_tasks = []

src/transformers/agents/python_interpreter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
class InterpreterError(ValueError):
3434
"""
35-
An error raised when the interpretor cannot evaluate a Python expression, due to syntax error or unsupported
35+
An error raised when the interpreter cannot evaluate a Python expression, due to syntax error or unsupported
3636
operations.
3737
"""
3838

@@ -713,14 +713,14 @@ def evaluate_ast(
713713
Evaluate an abstract syntax tree using the content of the variables stored in a state and only evaluating a given
714714
set of functions.
715715
716-
This function will recurse trough the nodes of the tree provided.
716+
This function will recurse through the nodes of the tree provided.
717717
718718
Args:
719719
expression (`ast.AST`):
720720
The code to evaluate, as an abstract syntax tree.
721721
state (`Dict[str, Any]`):
722722
A dictionary mapping variable names to values. The `state` is updated if need be when the evaluation
723-
encounters assignements.
723+
encounters assignments.
724724
static_tools (`Dict[str, Callable]`):
725725
Functions that may be called during the evaluation. Trying to change one of these static_tools will raise an error.
726726
custom_tools (`Dict[str, Callable]`):
@@ -736,7 +736,7 @@ def evaluate_ast(
736736
)
737737
OPERATIONS_COUNT += 1
738738
if isinstance(expression, ast.Assign):
739-
# Assignement -> we evaluate the assignment which should update the state
739+
# Assignment -> we evaluate the assignment which should update the state
740740
# We return the variable assigned as it may be used to determine the final result.
741741
return evaluate_assign(expression, state, static_tools, custom_tools)
742742
elif isinstance(expression, ast.AugAssign):

src/transformers/agents/translation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class TranslationTool(PipelineTool):
256256
},
257257
"tgt_lang": {
258258
"type": "string",
259-
"description": "The language for the desired ouput language. Written in plain English, such as 'Romanian', or 'Albanian'",
259+
"description": "The language for the desired output language. Written in plain English, such as 'Romanian', or 'Albanian'",
260260
},
261261
}
262262
output_type = "string"

0 commit comments

Comments
 (0)