Why is the completion not resolved in the promise ? #37
-
Hello and thanks a lot for this project ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi, @mspronesti The reason for using callback here is to stream tokens one by one so that you can display it in realtime(once the backend has inferred the next token) instead of waiting the accumulation of tokens all together which may cost a lot of time. Generally, users would like to see the results directly even they came out in sequence, but users will get frustrated if they wait the results for over several seconds(in some slow machine it get even worse). Thats why we choose to implement the streaming like this. The promise here is to notify the caller that all the inferencing progress has just completed. it is not used for accumulating tokens in sentences. |
Beta Was this translation helpful? Give feedback.
https://github.com/Atome-FE/llama-node/pull/39/files#diff-d50d95d4d2e1defa9457fce8ea6f9d0672c5da30e533e069a998a9ce0f542ef2R72
will introduce new promise resolve/reject type like this