Skip to content

Commit 4eee97d

Browse files
committed
add chat template deployment
1 parent 8011390 commit 4eee97d

File tree

1 file changed

+11
-7
lines changed
  • 11-embeddings-reranker-classification-tensorrt/BEI-skywork-skywork-reward-llama-3.1-8b-v0.2-reward-model-fp8

1 file changed

+11
-7
lines changed

11-embeddings-reranker-classification-tensorrt/BEI-skywork-skywork-reward-llama-3.1-8b-v0.2-reward-model-fp8/chat_template_deployment.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,14 @@ def send_to_deployment(messages: MESSAGE_TYPE):
4848

4949

5050
if __name__ == "__main__":
51-
messages = [
52-
{"role": "system", "content": "You are a helpful assistant."},
53-
{"role": "user", "content": "Hello, how are you?"},
54-
{"role": "assistant", "content": "I'm doing great. How can I help you today?"},
55-
{"role": "user", "content": "I'd like to show off how chat templating works!"},
56-
]
57-
send_to_deployment(messages)
51+
prompt = "Jane has 12 apples. She gives 4 apples to her friend Mark, then buys 1 more apple, and finally splits all her apples equally among herself and her 2 siblings. How many apples does each person get?"
52+
response1 = "1. Jane starts with 12 apples and gives 4 to Mark. 12 - 4 = 8. Jane now has 8 apples.\n2. Jane buys 1 more apple. 8 + 1 = 9. Jane now has 9 apples.\n3. Jane splits the 9 apples equally among herself and her 2 siblings (3 people in total). 9 ÷ 3 = 3 apples each. Each person gets 3 apples."
53+
response2 = "1. Jane starts with 12 apples and gives 4 to Mark. 12 - 4 = 8. Jane now has 8 apples.\n2. Jane buys 1 more apple. 8 + 1 = 9. Jane now has 9 apples.\n3. Jane splits the 9 apples equally among her 2 siblings (2 people in total). 9 ÷ 2 = 4.5 apples each. Each person gets 4 apples."
54+
55+
for response in [response1, response2]:
56+
messages = [
57+
{"role": "user", "content": prompt},
58+
{"role": "assistant", "content": response},
59+
]
60+
61+
print(send_to_deployment(messages))

0 commit comments

Comments
 (0)