Skip to content

Commit

Permalink
Add more block name alternatives
Browse files Browse the repository at this point in the history
  • Loading branch information
s-jse committed Aug 7, 2024
1 parent 982460b commit 34fbec4
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions chainlite/load_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,28 @@

# Initial setup for prompt_block_identifiers remains the same
prompt_block_identifiers = {
"input": ["# input\n", "# Input\n", "# INPUT\n"],
"output": ["# output\n", "# Output\n", "# OUTPUT\n"],
"input": [
"# input\n",
"# Input\n",
"# INPUT\n",
"# user\n",
"# User\n",
"# USER\n",
"# human\n",
"# Human\n",
"# HUMAN\n",
],
"output": [
"# output\n",
"# Output\n",
"# OUTPUT\n",
"# assistant\n",
"# Assistant\n",
"# ASSISTANT\n",
"# ai\n",
"# Ai\n",
"# AI\n",
],
"instruction": ["# instruction\n", "# Instruction\n", "# INSTRUCTION\n"],
"distillation_instruction": [
"# distillation instruction\n",
Expand Down Expand Up @@ -217,7 +237,10 @@ def _prompt_blocks_to_chat_messages(


def load_fewshot_prompt_template(
template_file: str, template_blocks:list[tuple[str]], is_distilled: bool, keep_indentation: bool
template_file: str,
template_blocks: list[tuple[str]],
is_distilled: bool,
keep_indentation: bool,
) -> Tuple[ChatPromptTemplate, str | None]:
if not template_blocks:
fp = load_template_file(template_file, keep_indentation)
Expand Down

0 comments on commit 34fbec4

Please sign in to comment.