MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / Llama2Prompter

Class Llama2Prompter

inference/utils/prompt_templates.py:125–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123
124
125class Llama2Prompter(OneShotBasePrompter):
126 def __init__(self, short_prompt=False):
127 system_inst = "A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions."
128 role1 = "### Human"
129 role2 = "### Assistant"
130 sen_spliter = "\n"
131 qa_spliter = "</s>"
132 user_example = "Got any creative ideas for a 10 year old's birthday?"
133 if short_prompt:
134 assistant_example = (
135 "Of course! Here are some creative ideas for a 10-year-old's birthday party:\n"
136 + "1. Treasure Hunt: Organize a treasure hunt in your backyard or nearby park. Create clues and riddles for the kids to solve, leading them to hidden treasures and surprises.\n"
137 + "2. Science Party: Plan a science-themed party where kids can engage in fun and interactive experiments. You can set up different stations with activities like making slime, erupting volcanoes, or creating simple chemical reactions.\n"
138 + "Remember to tailor the activities to the birthday child's interests and preferences. Have a great celebration!"
139 )
140 else:
141 assistant_example = (
142 "Of course! Here are some creative ideas for a 10-year-old's birthday party:\n"
143 + "1. Treasure Hunt: Organize a treasure hunt in your backyard or nearby park. Create clues and riddles for the kids to solve, leading them to hidden treasures and surprises.\n"
144 + "2. Science Party: Plan a science-themed party where kids can engage in fun and interactive experiments. You can set up different stations with activities like making slime, erupting volcanoes, or creating simple chemical reactions.\n"
145 + "3. Outdoor Movie Night: Set up a backyard movie night with a projector and a large screen or white sheet. Create a cozy seating area with blankets and pillows, and serve popcorn and snacks while the kids enjoy a favorite movie under the stars.\n"
146 + "4. DIY Crafts Party: Arrange a craft party where kids can unleash their creativity. Provide a variety of craft supplies like beads, paints, and fabrics, and let them create their own unique masterpieces to take home as party favors.\n"
147 + "5. Sports Olympics: Host a mini Olympics event with various sports and games. Set up different stations for activities like sack races, relay races, basketball shooting, and obstacle courses. Give out medals or certificates to the participants.\n"
148 + "6. Cooking Party: Have a cooking-themed party where the kids can prepare their own mini pizzas, cupcakes, or cookies. Provide toppings, frosting, and decorating supplies, and let them get hands-on in the kitchen.\n"
149 + "7. Superhero Training Camp: Create a superhero-themed party where the kids can engage in fun training activities. Set up an obstacle course, have them design their own superhero capes or masks, and organize superhero-themed games and challenges.\n"
150 + "8. Outdoor Adventure: Plan an outdoor adventure party at a local park or nature reserve. Arrange activities like hiking, nature scavenger hunts, or a picnic with games. Encourage exploration and appreciation for the outdoors.\n"
151 + "Remember to tailor the activities to the birthday child's interests and preferences. Have a great celebration!"
152 )
153 oneshot_example = [user_example, assistant_example]
154 super().__init__(
155 oneshot_example, system_inst, role1, role2, sen_spliter, qa_spliter
156 )
157
158class MetaMathPrompter(SimplePrompter):
159 def __init__(self):

Callers 1

get_prompterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected