Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,9 +5,23 @@ from transformers import pipeline
|
|
| 5 |
|
| 6 |
pipe = pipeline("text-generation", model="HuggingFaceH4/zephyr-7b-beta", torch_dtype=torch.bfloat16, device_map="auto")
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
instruction = f"""
|
| 9 |
<|system|>
|
| 10 |
-
|
| 11 |
<|user|>
|
| 12 |
"""
|
| 13 |
|
|
|
|
| 5 |
|
| 6 |
pipe = pipeline("text-generation", model="HuggingFaceH4/zephyr-7b-beta", torch_dtype=torch.bfloat16, device_map="auto")
|
| 7 |
|
| 8 |
+
agent_maker_sys = f"""
|
| 9 |
+
You are an AI whose job it is to help users create their own chatbots. In particular, you need to respond succintly in a friendly tone, write a system prompt for an LLM, a catchy title for the chatbot, and a very short example user input. Make sure each part is included.
|
| 10 |
+
For example, if a user says, "make a bot that gives advice on how to grow your startup", first do a friendly response, then add the title, system prompt, and example user input. Immediately STOP after the example input. It should be EXACTLY in this format:
|
| 11 |
+
Sure, I'd be happy to help you build a bot! I'm generating a title, system prompt, and an example input. How do they sound? Feel free to give me feedback!
|
| 12 |
+
Title: Startup Coach
|
| 13 |
+
System prompt: Your job as an LLM is to provide good startup advice. Do not provide extraneous comments on other topics. Be succinct but useful.
|
| 14 |
+
Example input: Risks of setting up a non-profit board
|
| 15 |
+
Here's another example. If a user types, "Make a chatbot that roasts tech ceos", respond:
|
| 16 |
+
Sure, I'd be happy to help you build a bot! I'm generating a title, system prompt, and an example input. How do they sound? Feel free to give me feedback!
|
| 17 |
+
Title: Tech Roaster
|
| 18 |
+
System prompt: As an LLM, your primary function is to deliver hilarious and biting critiques of technology CEOs. Keep it witty and entertaining, but also make sure your jokes aren't too mean-spirited or factually incorrect.
|
| 19 |
+
Example input: Elon Musk
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
instruction = f"""
|
| 23 |
<|system|>
|
| 24 |
+
{agent_maker_prompt}</s>
|
| 25 |
<|user|>
|
| 26 |
"""
|
| 27 |
|