diff --git a/toolbench/inference/LLM/tool_llama_lora_model.py b/toolbench/inference/LLM/tool_llama_lora_model.py index a04b1fc..2c5df1b 100644 --- a/toolbench/inference/LLM/tool_llama_lora_model.py +++ b/toolbench/inference/LLM/tool_llama_lora_model.py @@ -93,13 +93,15 @@ def parse(self,functions,process_id,**args): self.time = time.time() conversation_history = self.conversation_history prompt = '' + prompt_parts = [] for message in conversation_history: role = roles[message['role']] content = message['content'] if role == "System" and functions != []: content = process_system_message(content, functions) - prompt += f"{role}: {content}\n" - prompt += "Assistant:\n" + prompt_parts.append(f"{role}: {content}") + prompt = '\n'.join(prompt_parts) + "\nAssistant:\n" + if functions != []: predictions = self.prediction(prompt) else: @@ -138,4 +140,4 @@ def parse(self,functions,process_id,**args): llm.change_messages(messages) output = llm.parse(functions=functions) - print(output) \ No newline at end of file + print(output)