Hello community,
I am currently working on a program in VS Code that outputs a summary or something similar for a text that I previously select. I am controlling a model with the API of Vertex AI and passing my prompt to it. My program used to work flawlessly until a few weeks ago, but at some point, I received this error:
and I was advised that the problem lies at this point in the node-modules: "@google-cloud\vertexai\src\functions\post_fetch_processing.ts:133:17 at processTicksAndRejections (node:internal/process/task_queues:95:5)"
It can't really be my code, since I haven't changed it and even use the same text to generate a summary. The only thing I have found out is that it might have to do with the size of the text that I pass to the model. If the text is rather small (about 1,000 tokens) everything still works, but if the text gets bigger (about 27,000 tokens) I get the error.
Can someone help me out?
Just sharing my past experience.
Sometime back I had a similar error (`Failed to parse final chunk of stream`) when I was generating a streaming response from an AI model.
My finding is that the last response chunk in a streaming response, may or may not have test-response. Sometimes it could be just a trailing space or `\n` and other time no text block(maybe just an EOF acknowledge chunk.)
Suggestion: For each response chunk in a streaming response, check if there is a text info or not. (In my python code, instead of `print(response.choices[0])`, I used `if response.choices: print(response.choices[0])`.
Thank you for your contribution, I have now spent a few days trying to find out more about the error message. In part, you are also right, the error occurs when one of the chunks has no content. But, as far as I have found out with the tests, it does not have to be at the end of a text, it can also be in the middle of it. I tried it with your approach and wanted to catch the error, I also found the empty chunk, but unfortunately, the error message still comes after that. It occurs at this point in a Node_Module at this place node-modules: "@google-cloud\vertexai\src\functions\post_fetch_processing.ts:133:17 at processTicksAndRejections (node:internal/process/task_queues:95:5. The code in this file looks like this:
Sorry to hear this! Quick question. Have you considered using `max_token` limit in the configuration ?
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |