MCPcopy Create free account
hub / github.com/WangHanLinHenry/SPA-RL-Agent / write

Method write

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

Source from the content-addressed store, hash-verified

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

Callers 15

jsonl_add_dataFunction · 0.80
parse_results_amzFunction · 0.80
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

Calls 1

logMethod · 0.80

Tested by

no test coverage detected