Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
|
@@ -168,19 +168,12 @@ class StreamingChatbot {
|
|
| 168 |
}
|
| 169 |
});
|
| 170 |
|
| 171 |
-
//
|
| 172 |
-
const
|
| 173 |
-
`${msg.role === 'user' ? 'User' : 'Assistant'}: ${msg.content}`
|
| 174 |
-
).join('\n') + '\nAssistant:';
|
| 175 |
-
|
| 176 |
-
// Generate response with streaming
|
| 177 |
-
const output = await this.generator(conversationText, {
|
| 178 |
max_new_tokens: 300,
|
| 179 |
-
do_sample:
|
| 180 |
temperature: 0.7,
|
| 181 |
-
top_p: 0.9,
|
| 182 |
streamer: this.currentStreamer,
|
| 183 |
-
return_full_text: false
|
| 184 |
});
|
| 185 |
|
| 186 |
// Clean up streaming indicator if still present
|
|
|
|
| 168 |
}
|
| 169 |
});
|
| 170 |
|
| 171 |
+
// Use the messages array directly with the generator (like the original working code)
|
| 172 |
+
const output = await this.generator(this.messages, {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
max_new_tokens: 300,
|
| 174 |
+
do_sample: false,
|
| 175 |
temperature: 0.7,
|
|
|
|
| 176 |
streamer: this.currentStreamer,
|
|
|
|
| 177 |
});
|
| 178 |
|
| 179 |
// Clean up streaming indicator if still present
|