Spaces:
Running
Running
sarahciston
commited on
Commit
•
f27000a
1
Parent(s):
0dcbd91
try bloom with preprompt and no max tokens
Browse files
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]
|
10 |
let pField
|
11 |
-
let PREPROMPT = `
|
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 |
-
|
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,
|
29 |
-
var out = await pipe(INPUT
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
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')
|