Skip to content

Commit d1065b4

Browse files
Deepansharora27shukpa
authored andcommitted
#1: Returning Output Directly
Signed-off-by: Deepanshu Arora <deepansharora27@gmail.com>
1 parent 93d1c51 commit d1065b4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

fastchat/serve/cli.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,15 @@ def stream_output(self, output_stream):
5858
if now > pre:
5959
print(" ".join(output_text[pre:now]), end=" ", flush=True)
6060
pre = now
61-
print(" ".join(output_text[pre:]), flush=True)
62-
return " ".join(output_text)
61+
# print(" ".join(output_text[pre:]), flush=True)
62+
# return " ".join(output_text)
63+
relevant_output.append(" ".join(output_text[pre:]))
64+
self._stored_output = " ".join(output_text) # Store the entire output in the variable
65+
66+
return self._stored_output
67+
68+
def get_relevant_output(self) -> str:
69+
return self._stored_output
6370

6471

6572
class RichChatIO(ChatIO):

0 commit comments

Comments
 (0)