Skip to content

Commit

Permalink
[Paddle-pipelines] Release 0.5.3 for pipelines (#6216)
Browse files Browse the repository at this point in the history
* Release 0.6.0 for piplines

* change to 0.5.3

* Fix unitests

* Remove extra spaces
  • Loading branch information
w5688414 committed Jun 20, 2023
1 parent 225a59f commit 0c8055b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pipelines/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.2
0.5.3
6 changes: 3 additions & 3 deletions pipelines/pipelines/agents/agent_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def __init__(
final_answer_pattern: Optional[str] = None,
prompt_node_response: str = "",
transcript: str = "",
observation_prefix: str = "Observation: ",
llm_prefix: str = "Thought: ",
observation_prefix: str = "Observation:",
llm_prefix: str = "Thought:",
):
"""
:param current_step: The current step in the execution of the agent.
Expand Down Expand Up @@ -123,7 +123,7 @@ def completed(self, observation: Optional[str]) -> None:
:param observation: received observation from the Agent environment.
"""
self.transcript += (
f"{self.prompt_node_response}\n{self.observation_prefix} {observation}\n{self.llm_prefix} "
f"{self.prompt_node_response}\n{self.observation_prefix} {observation}\n{self.llm_prefix}"
if observation
else self.prompt_node_response
)
Expand Down
6 changes: 3 additions & 3 deletions pipelines/pipelines/agents/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def __init__(
tools: Optional[List[Tool]] = None,
tool_pattern: str = r"Tool:\s*(\w+)\s*Tool Input:\s*(?:\"([\s\S]*?)\"|((?:.|\n)*))\s*",
observation_prefix: str = "Observation: ",
llm_prefix: str = "Thought: ",
llm_prefix: str = "Thought:",
):
"""
:param tools: A list of tools to add to the ToolManager. Each tool must have a unique name.
Expand Down Expand Up @@ -245,8 +245,8 @@ def __init__(
prompt_parameters_resolver: Optional[Callable] = None,
max_steps: int = 8,
final_answer_pattern: str = r"Final Answer\s*:\s*(.*)",
observation_prefix: str = "Observation: ",
llm_prefix: str = "Thought: ",
observation_prefix: str = "Observation:",
llm_prefix: str = "Thought:",
):
"""
Creates an Agent instance.
Expand Down
4 changes: 3 additions & 1 deletion pipelines/tests/nodes/llm/test_chatglm_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

class TestChatGLMBot(unittest.TestCase):
def setUp(self):
self.chatbot = ChatGLMBot(model="__internal_testing__/tiny-random-chatglm", dtype="float32", tgt_length=8)
self.chatbot = ChatGLMBot(
model_name_or_path="__internal_testing__/tiny-random-chatglm", dtype="float32", tgt_length=8
)

def test_run(self):
prompt_text = "很高兴认识你"
Expand Down
4 changes: 3 additions & 1 deletion pipelines/tests/pipelines/test_chatbot_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ def test_run_with_truncated_history(self, mock_request):

class TestChatGLMPipeline(unittest.TestCase):
def setUp(self):
self.chat = ChatGLMBot(model="__internal_testing__/tiny-random-chatglm", dtype="float32", tgt_length=8)
self.chat = ChatGLMBot(
model_name_or_path="__internal_testing__/tiny-random-chatglm", dtype="float32", tgt_length=8
)

def test_run_without_history(self):
pipeline = Pipeline()
Expand Down

0 comments on commit 0c8055b

Please sign in to comment.