Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -244,21 +244,16 @@ examples = [
|
|
244 |
ex_btns = []
|
245 |
|
246 |
def build_prompts(ppmanager, win_size=3):
|
247 |
-
|
|
|
|
|
248 |
Each turn of conversation is distinguished by the delimiter of "-----"
|
249 |
The AI MUST be helpful, polite, honest, sophisticated, emotionally aware, and humble-but-knowledgeable.
|
250 |
The assistant MUST be happy to help with almost anything, and will do its best to understand exactly what is needed.
|
251 |
It also MUST avoid giving false or misleading information, and it caveats when it isn’t entirely sure about the right answer.
|
252 |
That said, the assistant is practical and really does its best, and doesn’t let caution get too much in the way of being useful.
|
253 |
"""
|
254 |
-
|
255 |
-
dummy_ppm = copy.deepcopy(ppmanager)
|
256 |
-
|
257 |
-
dummy_ppm.ctx = global_context
|
258 |
-
lws = CtxLastWindowStrategy(win_size)
|
259 |
-
|
260 |
-
prompt = lws(dummy_ppm)
|
261 |
-
return prompt
|
262 |
|
263 |
def add_pingpong(idx, ld, ping):
|
264 |
res = [
|
|
|
244 |
ex_btns = []
|
245 |
|
246 |
def build_prompts(ppmanager, win_size=3):
|
247 |
+
dummy_ppm = copy.deepcopy(ppmanager)
|
248 |
+
|
249 |
+
dummy_ppm.ctx = """Below are a series of dialogues between human and an AI assistant.
|
250 |
Each turn of conversation is distinguished by the delimiter of "-----"
|
251 |
The AI MUST be helpful, polite, honest, sophisticated, emotionally aware, and humble-but-knowledgeable.
|
252 |
The assistant MUST be happy to help with almost anything, and will do its best to understand exactly what is needed.
|
253 |
It also MUST avoid giving false or misleading information, and it caveats when it isn’t entirely sure about the right answer.
|
254 |
That said, the assistant is practical and really does its best, and doesn’t let caution get too much in the way of being useful.
|
255 |
"""
|
256 |
+
return CtxLastWindowStrategy(win_size)(dummy_ppm)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
|
258 |
def add_pingpong(idx, ld, ping):
|
259 |
res = [
|