Grag ex1.1 (#1123)

Signed-off-by: Rita Brugarolas <rita.brugarolas.brufau@intel.com>
Signed-off-by: theresa <theresa.shan@intel.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: theresa <theresa.shan@intel.com>
This commit is contained in:
rbrugaro
2024-11-14 21:17:06 -08:00
committed by GitHub
parent 39f68d5d6b
commit 6f8fa6a689
8 changed files with 29 additions and 16 deletions

View File

@@ -70,7 +70,11 @@ def align_outputs(self, data, cur_node, inputs, runtime_graph, llm_parameters_di
# handle template
# if user provides template, then format the prompt with it
# otherwise, use the default template
prompt = inputs.messages[0]["content"]
print("outputs before align:\n", inputs)
if isinstance(inputs.messages, str):
prompt = inputs.messages
else:
prompt = inputs.messages[0]["content"]
chat_template = llm_parameters_dict["chat_template"]
if chat_template:
prompt_template = PromptTemplate.from_template(chat_template)