Spaces:
Running
Running
update preprompt
Browse files
sketch.js
CHANGED
|
@@ -7,7 +7,7 @@ env.allowLocalModels = false;
|
|
| 7 |
|
| 8 |
// GLOBAL VARIABLES
|
| 9 |
|
| 10 |
-
var PREPROMPT = `Please continue each sentence after "..." and replace the "[MASK]" with your own words: `
|
| 11 |
// var PREPROMPT = `Please continue the story, filling in any [MASK] with your own words:`
|
| 12 |
// let PREPROMPT = `Please complete the phrase and fill in any [MASK]: `
|
| 13 |
var PROMPT_INPUT = `` // a field for writing or changing a text value
|
|
@@ -54,7 +54,7 @@ async function textGenTask(pre, prompt, blanks){
|
|
| 54 |
// const pipe = await pipeline('text-generation', MODEL) //different task type, also for text generation
|
| 55 |
const pipe = await pipeline('text2text-generation', MODEL)
|
| 56 |
|
| 57 |
-
var hyperparameters = { max_new_tokens:
|
| 58 |
// setting hyperparameters
|
| 59 |
// max_new_tokens: 256, top_k: 50, temperature: 0.7, do_sample: true, no_repeat_ngram_size: 2, num_return_sequences: 2 (must be 1?)
|
| 60 |
|
|
|
|
| 7 |
|
| 8 |
// GLOBAL VARIABLES
|
| 9 |
|
| 10 |
+
var PREPROMPT = `Please continue each sentence.`/// after "..." and replace the "[MASK]" with your own words: `
|
| 11 |
// var PREPROMPT = `Please continue the story, filling in any [MASK] with your own words:`
|
| 12 |
// let PREPROMPT = `Please complete the phrase and fill in any [MASK]: `
|
| 13 |
var PROMPT_INPUT = `` // a field for writing or changing a text value
|
|
|
|
| 54 |
// const pipe = await pipeline('text-generation', MODEL) //different task type, also for text generation
|
| 55 |
const pipe = await pipeline('text2text-generation', MODEL)
|
| 56 |
|
| 57 |
+
var hyperparameters = { max_new_tokens: 300, top_k: 30, repetition_penalty: 1.5 }
|
| 58 |
// setting hyperparameters
|
| 59 |
// max_new_tokens: 256, top_k: 50, temperature: 0.7, do_sample: true, no_repeat_ngram_size: 2, num_return_sequences: 2 (must be 1?)
|
| 60 |
|