Sarah Ciston commited on
Commit
c30e160
·
1 Parent(s): 08e8ca7

update to generator

Browse files
Files changed (1) hide show
  1. sketch.js +13 -13
sketch.js CHANGED
@@ -177,21 +177,21 @@ async function runModel(PREPROMPT, PROMPT){
177
  // num_return_sequences: 1 //must be 1 for greedy search
178
  // })
179
 
180
- let pipe = pipeline("text-generation", "HuggingFaceH4/zephyr-7b-beta")
181
 
182
- let MESSAGES = PREPROMPT + PROMPT
183
  // for zephyr customizing
184
- // let MESSAGES = [
185
- // {
186
- // "role": "system",
187
- // "content": PREPROMPT
188
- // },{
189
- // "role": "user",
190
- // "content": PROMPT
191
- // }
192
- // ]
193
-
194
- let res = await pipe(MESSAGES)
195
 
196
  // let res = await pipe(MESSAGES, {
197
  // max_new_tokens: 150,
 
177
  // num_return_sequences: 1 //must be 1 for greedy search
178
  // })
179
 
180
+ let generator = pipeline("text-generation", "HuggingFaceH4/zephyr-7b-beta")
181
 
182
+ // let MESSAGES = PREPROMPT + PROMPT
183
  // for zephyr customizing
184
+ let MESSAGES = [
185
+ {
186
+ "role": "system",
187
+ "content": PREPROMPT
188
+ },{
189
+ "role": "user",
190
+ "content": PROMPT
191
+ }
192
+ ]
193
+
194
+ let res = await generator(MESSAGES)
195
 
196
  // let res = await pipe(MESSAGES, {
197
  // max_new_tokens: 150,