Spaces:
Paused
Paused
Commit
·
8cd49d2
1
Parent(s):
c096cf6
Update src/pages/api/stream.js
Browse files- src/pages/api/stream.js +1 -6
src/pages/api/stream.js
CHANGED
@@ -39,7 +39,7 @@ export const LLMStream = async (
|
|
39 |
],
|
40 |
max_tokens: 1000,
|
41 |
temperature: temperature,
|
42 |
-
stream: true
|
43 |
}),
|
44 |
});
|
45 |
|
@@ -70,11 +70,6 @@ export const LLMStream = async (
|
|
70 |
if (event.type === 'event') {
|
71 |
console.log(event);
|
72 |
const data = event.data;
|
73 |
-
if (data === '[DONE]') {
|
74 |
-
controller.close();
|
75 |
-
return;
|
76 |
-
}
|
77 |
-
|
78 |
try {
|
79 |
const json = JSON.parse(data);
|
80 |
if (json.choices[0].finish_reason === "stop") {
|
|
|
39 |
],
|
40 |
max_tokens: 1000,
|
41 |
temperature: temperature,
|
42 |
+
stream: true
|
43 |
}),
|
44 |
});
|
45 |
|
|
|
70 |
if (event.type === 'event') {
|
71 |
console.log(event);
|
72 |
const data = event.data;
|
|
|
|
|
|
|
|
|
|
|
73 |
try {
|
74 |
const json = JSON.parse(data);
|
75 |
if (json.choices[0].finish_reason === "stop") {
|