akhaliq HF Staff commited on
Commit
6b9de7b
·
verified ·
1 Parent(s): 26ba43f

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +3 -10
index.js CHANGED
@@ -168,19 +168,12 @@ class StreamingChatbot {
168
  }
169
  });
170
 
171
- // Prepare conversation context
172
- const conversationText = this.messages.map(msg =>
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: true,
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