Spaces:
Running
Running
Update bin_public/app/overwrites.py
Browse files
bin_public/app/overwrites.py
CHANGED
@@ -6,6 +6,7 @@ import mdtex2html
|
|
6 |
import logging
|
7 |
|
8 |
from bin_public.config.presets import *
|
|
|
9 |
|
10 |
|
11 |
def compact_text_chunks(self, prompt: Prompt, text_chunks: List[str]) -> List[str]:
|
@@ -27,18 +28,16 @@ def postprocess(
|
|
27 |
Returns:
|
28 |
List of tuples representing the message and response. Each message and response will be a string of HTML.
|
29 |
"""
|
30 |
-
if y is None:
|
31 |
return []
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
)
|
39 |
return y
|
40 |
|
41 |
-
|
42 |
with open(customJS_Path, "r", encoding="utf-8") as f, open(Kelpy_Codos_Path, "r", encoding="utf-8") as f2:
|
43 |
customJS = f.read()
|
44 |
kelpyCodos = f2.read()
|
|
|
6 |
import logging
|
7 |
|
8 |
from bin_public.config.presets import *
|
9 |
+
from bin_public.app.llama_func import *
|
10 |
|
11 |
|
12 |
def compact_text_chunks(self, prompt: Prompt, text_chunks: List[str]) -> List[str]:
|
|
|
28 |
Returns:
|
29 |
List of tuples representing the message and response. Each message and response will be a string of HTML.
|
30 |
"""
|
31 |
+
if y is None or y == []:
|
32 |
return []
|
33 |
+
user, bot = y[-1]
|
34 |
+
if not detect_converted_mark(user):
|
35 |
+
user = convert_asis(user)
|
36 |
+
if not detect_converted_mark(bot):
|
37 |
+
bot = convert_mdtext(bot)
|
38 |
+
y[-1] = (user, bot)
|
|
|
39 |
return y
|
40 |
|
|
|
41 |
with open(customJS_Path, "r", encoding="utf-8") as f, open(Kelpy_Codos_Path, "r", encoding="utf-8") as f2:
|
42 |
customJS = f.read()
|
43 |
kelpyCodos = f2.read()
|