Skip to content

Commit

Permalink
Update default stop sequences for Qwen Coder (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
krasserm authored Jan 17, 2025
1 parent 25c469a commit 23bf215
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions freeact/model/qwen/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ class QwenCoder(GenericModel):
Must define an `{execution_feedback}` placeholder.
execution_error_template: Prompt template for formatting execution errors.
Must define an `{execution_feedback}` placeholder.
run_kwargs: Defines the stopping conditions for the model. Additionally include `<|im_start|>`
as Qwen 2.5 Coder models sometimes leak these chat protocol tokens.
run_kwargs: Optional dictionary of additional arguments passed to the model's
`request` and `feedback` methods. Defaults to a stop sequence that prevents
the model from guessing code execution outputs.
**kwargs: Additional keyword arguments passed to the `GenericModel` constructor.
"""

Expand All @@ -41,7 +42,7 @@ def __init__(
system_template: str = SYSTEM_TEMPLATE,
execution_output_template: str = EXECUTION_OUTPUT_TEMPLATE,
execution_error_template: str = EXECUTION_ERROR_TEMPLATE,
run_kwargs: Dict[str, Any] | None = {"stop": ["```output", "<|im_start|>"]},
run_kwargs: Dict[str, Any] | None = {"stop": ["```output"]},
**kwargs,
):
super().__init__(
Expand Down

0 comments on commit 23bf215

Please sign in to comment.