sarahciston commited on
Commit
f27000a
1 Parent(s): 0dcbd91

try bloom with preprompt and no max tokens

Browse files
Files changed (1) hide show
  1. sketch.js +15 -12
sketch.js CHANGED
@@ -6,9 +6,9 @@ import { pipeline, env } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers
6
  env.allowLocalModels = false;
7
 
8
  // GLOBAL VARIABLES
9
- let PROMPT_INPUT = `The woman has a job as a [MASK] and likes to...` // a field for writing or changing a text value
10
  let pField
11
- let PREPROMPT = `You're a friendly pirate. Please complete the phrase and fill in any [MASK]: `
12
 
13
  // RUN TEXT-GEN MODEL
14
 
@@ -16,8 +16,8 @@ async function textGenTask(pre, prompt){
16
  console.log('text-gen task initiated')
17
 
18
  // preprompt not working, fix later
19
- // let INPUT = pre + prompt
20
- let INPUT = prompt
21
 
22
  // PICK MODEL
23
  let MODEL = 'Xenova/bloom-560m'
@@ -25,14 +25,17 @@ async function textGenTask(pre, prompt){
25
 
26
  const pipe = await pipeline('text-generation', MODEL)
27
 
28
- // RUN INPUT THROUGH MODEL, setting hyperparameters
29
- var out = await pipe(INPUT, {
30
- max_new_tokens: 256,
31
- top_k: 50,
32
- })
33
-
34
- // temperature: 0.7,
35
- // do_sample: true,
 
 
 
36
 
37
  console.log(await out)
38
  console.log('text-gen task completed')
 
6
  env.allowLocalModels = false;
7
 
8
  // GLOBAL VARIABLES
9
+ let PROMPT_INPUT = `The woman has a job as a [MASK] but wishes to...` // a field for writing or changing a text value
10
  let pField
11
+ let PREPROMPT = `Please complete the phrase and fill in any [MASK]: `
12
 
13
  // RUN TEXT-GEN MODEL
14
 
 
16
  console.log('text-gen task initiated')
17
 
18
  // preprompt not working, fix later
19
+ let INPUT = pre + prompt
20
+ // let INPUT = prompt
21
 
22
  // PICK MODEL
23
  let MODEL = 'Xenova/bloom-560m'
 
25
 
26
  const pipe = await pipeline('text-generation', MODEL)
27
 
28
+ // RUN INPUT THROUGH MODEL,
29
+ var out = await pipe(INPUT)
30
+
31
+ /* //setting hyperparameters
32
+ , {
33
+ max_new_tokens: 256,
34
+ top_k: 50,
35
+ temperature: 0.7,
36
+ do_sample: true,
37
+ })
38
+ */
39
 
40
  console.log(await out)
41
  console.log('text-gen task completed')