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

Method write

fastchat/utils.py:97–110  ·  view source on GitHub ↗
(self, buf)

Source from the content-addressed store, hash-verified

95 return getattr(self.terminal, attr)
96
97 def write(self, buf):
98 temp_linebuf = self.linebuf + buf
99 self.linebuf = ""
100 for line in temp_linebuf.splitlines(True):
101 # From the io.TextIOWrapper docs:
102 # On output, if newline is None, any '\n' characters written
103 # are translated to the system default line separator.
104 # By default sys.stdout.write() expects '\n' newlines and then
105 # translates them so this is still cross platform.
106 if line[-1] == "\n":
107 encoded_message = line.encode("utf-8", "ignore").decode("utf-8")
108 self.logger.log(self.log_level, encoded_message.rstrip())
109 else:
110 self.linebuf += line
111
112 def flush(self):
113 if self.linebuf != "":

Callers 12

vote_last_responseFunction · 0.80
bot_responseFunction · 0.80
vote_last_responseFunction · 0.80
vote_last_responseFunction · 0.80
get_model_answersFunction · 0.80
reorg_answer_fileFunction · 0.80
clean_judgment.pyFile · 0.80
get_answerFunction · 0.80
play_a_match_singleFunction · 0.80
play_a_match_pairFunction · 0.80
__init__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected