Merge branch 'mariusgau-patch-Error-parsing-Ollama' of https://github.com/mariusgau/continue into mariusgau-mariusgau-patch-Error-parsing-Ollama

This commit is contained in:
Nate Sesti 2024-03-23 13:48:44 -07:00
commit be8e635091

View file

@ -164,6 +164,7 @@ class Ollama extends BaseLLM {
buffer += value;
// Split the buffer into individual JSON chunks
const chunks = buffer.split("\n");
buffer = chunks.pop() ?? "";
for (let i = 0; i < chunks.length; i++) {
const chunk = chunks[i];
@ -180,8 +181,6 @@ class Ollama extends BaseLLM {
}
}
}
// Assign the last chunk to the buffer
buffer = chunks[chunks.length - 1];
}
}