Skip to content

Commit

Permalink
fix: fix prompt postfix
Browse files Browse the repository at this point in the history
  • Loading branch information
vTuanpham committed Sep 17, 2024
1 parent b6e9891 commit 7c7dbb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion providers/groq_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def _do_translate(self, input_data: Union[str, List[str]],
prefix_prompt = f"{prefix_prompt_block}\n"
prefix_prompt += prefix_separator
postfix_prompt = postfix_separator
postfix_prompt = f"\n{postfix_prompt_block}"
postfix_prompt += f"\n{postfix_prompt_block}"

translated_system_prompt += "\n\n" + postfix_system_prompt if postfix_system_prompt else ""
translated_prompt = prefix_prompt + "\n\n" + prompt + "\n\n" + postfix_prompt + "\n\n" + translated_postfix_prompt
Expand All @@ -181,6 +181,9 @@ def _do_translate(self, input_data: Union[str, List[str]],
"max_tokens": 8000,
"stream": False,
}

print(f"System prompt: {translated_system_prompt}\n")
print(f"User prompt: {translated_prompt}\n")

if data_type == "list":
chat_args["response_format"] = {"type": "json_object"}
Expand Down

0 comments on commit 7c7dbb0

Please sign in to comment.