MCPcopy
hub / github.com/lm-sys/FastChat / process_response

Function process_response

fastchat/model/model_chatglm.py:24–37  ·  view source on GitHub ↗
(response)

Source from the content-addressed store, hash-verified

22
23
24def process_response(response):
25 response = response.strip()
26 response = response.replace("[[训练时间]]", "2023年")
27 punkts = [
28 [",", ","],
29 ["!", "!"],
30 [":", ":"],
31 [";", ";"],
32 ["\?", "?"],
33 ]
34 for item in punkts:
35 response = re.sub(r"([\u4e00-\u9fff])%s" % item[0], r"\1%s" % item[1], response)
36 response = re.sub(r"%s([\u4e00-\u9fff])" % item[0], r"%s\1" % item[1], response)
37 return response
38
39
40def recover_message_list(prompt):

Callers 1

generate_stream_chatglmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…