Skip to content

Commit

Permalink
ensure system prompt obeys constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarx authored Jul 21, 2023
1 parent 62cd5a4 commit 14bffda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def build_chat_prompt(doc: Document, prompt_head: str, max_content_len: int = 20
user_prompt = f"<content-{i}>{doc.title}\n\n{content}</content-{i}>\n"
user_prompt += f"<tags-{i}>"
messages = [
{'role':'system', 'content':system_prompt},
{'role':'system', 'content':system_prompt[:max_content_len]},
{'role':'user', 'content':user_prompt},
]
return messages
Expand Down

0 comments on commit 14bffda

Please sign in to comment.