mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
chore: fix message descriptions in arguments and comments (#36504)
chore: fix messagedescriptions in arguments and comments
This commit is contained in:
parent
acb8586dd9
commit
28159aee63
@ -332,7 +332,7 @@ def format_prompt_with_tools(toolbox: Toolbox, prompt_template: str, tool_descri
|
||||
def show_agents_descriptions(managed_agents: list):
|
||||
managed_agents_descriptions = """
|
||||
You can also give requests to team members.
|
||||
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.
|
||||
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.
|
||||
Given that this team member is a real human, you should be very verbose in your request.
|
||||
Here is a list of the team members that you can call:"""
|
||||
for agent in managed_agents.values():
|
||||
|
@ -275,7 +275,7 @@ def score_code(agent_answer, theoretical_answer, verbose: bool = False):
|
||||
return 1
|
||||
elif isinstance(agent_answer, dict) and any(v in theoretical_answer for v in agent_answer.values()):
|
||||
if verbose:
|
||||
print("Almsot perfect, result in state!")
|
||||
print("Almost perfect, result in state!")
|
||||
return 0.75
|
||||
else:
|
||||
if verbose:
|
||||
@ -345,7 +345,7 @@ def evaluate_agent(agent, batch_size=8, verbose=False, return_errors=False):
|
||||
missing_tools = set(TEST_TOOLS) - agent_tools
|
||||
unexpected_tools = set(agent_tools) - TEST_TOOLS
|
||||
raise ValueError(
|
||||
f"Fix the test tools in the evaluate_agent module. Tools mising: {missing_tools}. Extra tools: {unexpected_tools}."
|
||||
f"Fix the test tools in the evaluate_agent module. Tools missing: {missing_tools}. Extra tools: {unexpected_tools}."
|
||||
)
|
||||
|
||||
eval_tasks = []
|
||||
|
@ -32,7 +32,7 @@ if is_pandas_available():
|
||||
|
||||
class InterpreterError(ValueError):
|
||||
"""
|
||||
An error raised when the interpretor cannot evaluate a Python expression, due to syntax error or unsupported
|
||||
An error raised when the interpreter cannot evaluate a Python expression, due to syntax error or unsupported
|
||||
operations.
|
||||
"""
|
||||
|
||||
@ -713,14 +713,14 @@ def evaluate_ast(
|
||||
Evaluate an abstract syntax tree using the content of the variables stored in a state and only evaluating a given
|
||||
set of functions.
|
||||
|
||||
This function will recurse trough the nodes of the tree provided.
|
||||
This function will recurse through the nodes of the tree provided.
|
||||
|
||||
Args:
|
||||
expression (`ast.AST`):
|
||||
The code to evaluate, as an abstract syntax tree.
|
||||
state (`Dict[str, Any]`):
|
||||
A dictionary mapping variable names to values. The `state` is updated if need be when the evaluation
|
||||
encounters assignements.
|
||||
encounters assignments.
|
||||
static_tools (`Dict[str, Callable]`):
|
||||
Functions that may be called during the evaluation. Trying to change one of these static_tools will raise an error.
|
||||
custom_tools (`Dict[str, Callable]`):
|
||||
@ -736,7 +736,7 @@ def evaluate_ast(
|
||||
)
|
||||
OPERATIONS_COUNT += 1
|
||||
if isinstance(expression, ast.Assign):
|
||||
# Assignement -> we evaluate the assignment which should update the state
|
||||
# Assignment -> we evaluate the assignment which should update the state
|
||||
# We return the variable assigned as it may be used to determine the final result.
|
||||
return evaluate_assign(expression, state, static_tools, custom_tools)
|
||||
elif isinstance(expression, ast.AugAssign):
|
||||
|
@ -256,7 +256,7 @@ class TranslationTool(PipelineTool):
|
||||
},
|
||||
"tgt_lang": {
|
||||
"type": "string",
|
||||
"description": "The language for the desired ouput language. Written in plain English, such as 'Romanian', or 'Albanian'",
|
||||
"description": "The language for the desired output language. Written in plain English, such as 'Romanian', or 'Albanian'",
|
||||
},
|
||||
}
|
||||
output_type = "string"
|
||||
|
Loading…
Reference in New Issue
Block a user