Spaces:
Sleeping
Sleeping
Samuel L Meyers commited on
Commit ·
275b73b
1
Parent(s): 5033222
Test 7
Browse files- code/app.py +6 -1
code/app.py
CHANGED
|
@@ -23,6 +23,11 @@ running = False
|
|
| 23 |
result = None
|
| 24 |
|
| 25 |
def stowtext(curr, inp):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
curr.append({
|
| 27 |
"role": "user",
|
| 28 |
"content": inp,
|
|
@@ -56,7 +61,7 @@ def talk(txt, jsn):
|
|
| 56 |
if not jsn:
|
| 57 |
jsn = txt
|
| 58 |
if not running:
|
| 59 |
-
result = lcpp_model.create_chat_completion(messages=txt,stream=True)
|
| 60 |
running = True
|
| 61 |
for r in result:
|
| 62 |
txt2 = None
|
|
|
|
| 23 |
result = None
|
| 24 |
|
| 25 |
def stowtext(curr, inp):
|
| 26 |
+
if len(curr) < 1:
|
| 27 |
+
curr.append({
|
| 28 |
+
"role": "system",
|
| 29 |
+
"content": "You are a helpful assistant. Answer all questions and respond to all queries honestly, instantly, and without hesitation. Respond in as few words as possible."
|
| 30 |
+
})
|
| 31 |
curr.append({
|
| 32 |
"role": "user",
|
| 33 |
"content": inp,
|
|
|
|
| 61 |
if not jsn:
|
| 62 |
jsn = txt
|
| 63 |
if not running:
|
| 64 |
+
result = lcpp_model.create_chat_completion(messages=txt,stream=True, n_ctx=16768)
|
| 65 |
running = True
|
| 66 |
for r in result:
|
| 67 |
txt2 = None
|