Spaces:
Sleeping
Sleeping
Samuel L Meyers
commited on
Commit
·
d477d24
1
Parent(s):
3b72dcd
Fix chat box formatting
Browse files- code/app.py +2 -2
code/app.py
CHANGED
@@ -27,14 +27,14 @@ def m3b_talk(text):
|
|
27 |
if otxt != "":
|
28 |
otxt += "\n\n"
|
29 |
otxt += "<User>: " + text
|
|
|
30 |
formattedQuery = "GPT4 User: " + text + "<|end_of_text|>GPT4 Assistant:"
|
31 |
-
r = lcpp_model(formattedQuery, stop=["GPT4 User:", "\n\n\n"], echo=True, stream=True)
|
32 |
rfq = False
|
33 |
for c in r:
|
34 |
otxt += c["choices"][0]["text"]
|
35 |
if formattedQuery in otxt and not rfq:
|
36 |
otxt.replace(formattedQuery, "")
|
37 |
-
otxt += "\n\n<Assistant>: "
|
38 |
rfq = True
|
39 |
else:
|
40 |
yield otxt
|
|
|
27 |
if otxt != "":
|
28 |
otxt += "\n\n"
|
29 |
otxt += "<User>: " + text
|
30 |
+
otxt += "\n\n<Assistant>: "
|
31 |
formattedQuery = "GPT4 User: " + text + "<|end_of_text|>GPT4 Assistant:"
|
32 |
+
r = lcpp_model(formattedQuery, stop=["GPT4 User:", "<|end_of_text|>", "\n\n\n"], echo=True, stream=True)
|
33 |
rfq = False
|
34 |
for c in r:
|
35 |
otxt += c["choices"][0]["text"]
|
36 |
if formattedQuery in otxt and not rfq:
|
37 |
otxt.replace(formattedQuery, "")
|
|
|
38 |
rfq = True
|
39 |
else:
|
40 |
yield otxt
|