File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1071,13 +1071,18 @@ def for_non_stream():
10711071 busy_bar .start_spinning ()
10721072 generated_response = generate_response ()
10731073
1074- if normal_stdout :
1075- # Resolves : https://github.com/Simatwa/python-tgpt/issues/42
1074+ if normal_stdout or not self . prettify and not self . disable_stream :
1075+ # Resolves : https://github.com/Simatwa/python-tgpt/issues/42 & 43
10761076 cached_response : str = ""
1077+ if not normal_stdout :
1078+ busy_bar .stop_spinning ()
10771079 for response in generated_response :
1080+ offset = len (cached_response )
1081+ print (response [offset :], end = "" )
10781082 cached_response = response
1079- pass
1080- print (cached_response )
1083+ if not normal_stdout :
1084+ # Interactive prompt
1085+ print ("" )
10811086 return
10821087
10831088 if self .quiet :
You can’t perform that action at this time.
0 commit comments