Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

How to avoid typewriter/1 by 1 word generation via yield from generate method, from %appdata% ...\Local\Programs\Python\Python39\Lib\site-packages\pyllamacpp....\pyllamacpp\model.py etc #106

Open
g0dEngineer opened this issue May 9, 2023 · 2 comments

Comments

@g0dEngineer
Copy link

How to avoid one by one word generation via yield from generate method, from %appdata% ...\Local\Programs\Python\Python39\Lib\site-packages\pyllamacpp....\pyllamacpp\model.py etc?

So far I've accumulated the yield tokens in a variable, and printed that all out at once, instead of the typewriter effect by default, similar to WebUi variant by Paris Neo. (Though I don't know where Paris may be overriding generate method from above or similar like pygptj site package model file.

~Has anyone managed to override the yield with a simple accumulator without generating double the outputs?

@g0dEngineer
Copy link
Author

Wait, nevermind.

In NomicAi's standard installations, I see that cpp_generate in both pygpt4all's and pygpt4all.models' model.py function already returns a str as a data type, and doesn't seem to include any yield explicitly, although pygpt4all related implementation seems to not suppress cmd responses line by line, while pygpt4all.models' cpp_generate implementation seems to suppress/exclude this cmd printout

@g0dEngineer
Copy link
Author

I see that others have asked similar questions elsewhere, though seems they did not find out about cpp_generate yet.

https://stackoverflow.com/questions/76161686/output-full-response-as-string-and-suppress-model-parameters

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant