Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,10 @@ def format_prompt(message, history):
|
|
16 |
agents =[
|
17 |
"WEB_DEV",
|
18 |
"AI_SYSTEM_PROMPT",
|
19 |
-
"PYTHON_CODE_DEV"
|
|
|
|
|
|
|
20 |
]
|
21 |
def generate(
|
22 |
prompt, history, agent_name=agents[0], sys_prompt="", temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0,
|
@@ -26,6 +29,12 @@ def generate(
|
|
26 |
agent=prompts.WEB_DEV
|
27 |
if agent_name == "WEB_DEV":
|
28 |
agent = prompts.WEB_DEV_SYSTEM_PROMPT
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
if agent_name == "AI_SYSTEM_PROMPT":
|
30 |
agent = prompts.AI_SYSTEM_PROMPT
|
31 |
if agent_name == "PYTHON_CODE_DEV":
|
@@ -108,14 +117,17 @@ additional_inputs=[
|
|
108 |
|
109 |
]
|
110 |
|
111 |
-
examples=[["Write a simple working game in HTML5", agents[
|
|
|
|
|
|
|
112 |
["Write high quality personal website to show off my adventure sports hobby", agents[0], None, None, None, None, ],
|
113 |
-
["I'm planning a vacation to Japan. Can you suggest a one-week itinerary including must-visit places and local cuisines to try?",
|
114 |
-
["Can you write a short story about a time-traveling detective who solves historical mysteries?",
|
115 |
-
["I'm trying to learn French. Can you provide some common phrases that would be useful for a beginner, along with their pronunciations?",
|
116 |
-
["I have chicken, rice, and bell peppers in my kitchen. Can you suggest an easy recipe I can make with these ingredients?",
|
117 |
-
["Can you explain how the QuickSort algorithm works and provide a Python implementation?",
|
118 |
-
["What are some unique features of Rust that make it stand out compared to other systems programming languages like C++?",
|
119 |
]
|
120 |
|
121 |
|
|
|
16 |
agents =[
|
17 |
"WEB_DEV",
|
18 |
"AI_SYSTEM_PROMPT",
|
19 |
+
"PYTHON_CODE_DEV",
|
20 |
+
"CODE_REVIEW_ASSISTANT ",
|
21 |
+
"CONTENT_WRITER_EDITOR ",
|
22 |
+
"SOCIAL_MEDIA_MANAGER ",
|
23 |
]
|
24 |
def generate(
|
25 |
prompt, history, agent_name=agents[0], sys_prompt="", temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0,
|
|
|
29 |
agent=prompts.WEB_DEV
|
30 |
if agent_name == "WEB_DEV":
|
31 |
agent = prompts.WEB_DEV_SYSTEM_PROMPT
|
32 |
+
if agent_name == "CODE_REVIEW_ASSISTANT":
|
33 |
+
agent = prompts.CODE_REVIEW_ASSISTANT
|
34 |
+
if agent_name == "CONTENT_WRITER_EDITOR":
|
35 |
+
agent = prompts.CONTENT_WRITER_EDITOR
|
36 |
+
if agent_name == "SOCIAL_MEDIA_MANAGER":
|
37 |
+
agent = prompts.SOCIAL_MEDIA_MANAGER
|
38 |
if agent_name == "AI_SYSTEM_PROMPT":
|
39 |
agent = prompts.AI_SYSTEM_PROMPT
|
40 |
if agent_name == "PYTHON_CODE_DEV":
|
|
|
117 |
|
118 |
]
|
119 |
|
120 |
+
examples=[["Write a simple working game in HTML5", agents[0], None, None, None, None, ],
|
121 |
+
["Choose 3 useful types of AI agents, and create a detailed System Prompt to align each of them.", agents[1], None, None, None, None, ],
|
122 |
+
["Explain it to me in a childrens story how Nuclear Fission works", agents[4], None, None, None, None, ],
|
123 |
+
["Show a bunch of examples of catchy ways to post, 'I had a ham sandwich for lunch today'", agents[5], None, None, None, None, ],
|
124 |
["Write high quality personal website to show off my adventure sports hobby", agents[0], None, None, None, None, ],
|
125 |
+
["I'm planning a vacation to Japan. Can you suggest a one-week itinerary including must-visit places and local cuisines to try?", agents[4], None, None, None, None, ],
|
126 |
+
["Can you write a short story about a time-traveling detective who solves historical mysteries?", agents[4], None, None, None, None,],
|
127 |
+
["I'm trying to learn French. Can you provide some common phrases that would be useful for a beginner, along with their pronunciations?", agents[4], None, None, None, None,],
|
128 |
+
["I have chicken, rice, and bell peppers in my kitchen. Can you suggest an easy recipe I can make with these ingredients?", agents[4], None, None, None, None,],
|
129 |
+
["Can you explain how the QuickSort algorithm works and provide a Python implementation?", agents[2], None, None, None, None,],
|
130 |
+
["What are some unique features of Rust that make it stand out compared to other systems programming languages like C++?", agents[3], None, None, None, None,],
|
131 |
]
|
132 |
|
133 |
|