Closed RasyiidWho closed 8 months ago
The current chunk will entail the previous one and the newly created as illustrated here.
So something like this will definitely work out pretty fine.
import pytgpt.leo as leo
bot = leo.LEO(False)
previous_chunk = ''
for chunk in bot.chat('Okay I get you', stream=True):
print(chunk.replace(previous_chunk,''), end='')
previous_chunk=chunk
Streaming response overlapping even after using flush, seems like chuck creating new buffer every loop. Expected result are streamed string that overwrite previous string from buffer.
Step to reproduce:
Streamed print response:
GreatGreat toGreat to hearGreat to hear!
Expected print response:
Great to hear!