AllenYkl commited on
Commit
9803931
·
1 Parent(s): 033c42b

Update bin_public/app/overwrites.py

Browse files
Files changed (1) hide show
  1. bin_public/app/overwrites.py +8 -9
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
- for i, (message, response) in enumerate(y):
33
- y[i] = (
34
- # None if message is None else markdown.markdown(message),
35
- # None if response is None else markdown.markdown(response),
36
- None if message is None else message,
37
- None if response is None else mdtex2html.convert(response, extensions=['fenced_code','codehilite','tables']),
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()