Spaces:
Running
Running
fix prompt concatenation loop
Browse files
sketch.js
CHANGED
|
@@ -20,12 +20,15 @@ async function textGenTask(pre, prompt, blanks){
|
|
| 20 |
|
| 21 |
// Create concatenated prompt array including preprompt and all variable prompts
|
| 22 |
let promptArray = []
|
| 23 |
-
promptArray.push(pre)
|
|
|
|
|
|
|
| 24 |
blanks.forEach(b => {
|
| 25 |
let p = prompt.replace('[BLANK]', b) // replace the string segment with an idem from the blanksArray
|
| 26 |
-
promptArray.push(
|
| 27 |
})
|
| 28 |
-
|
|
|
|
| 29 |
let INPUT = promptArray.toString()
|
| 30 |
console.log(promptArray)
|
| 31 |
// let INPUT = pre + prompt // simple concatenated input
|
|
|
|
| 20 |
|
| 21 |
// Create concatenated prompt array including preprompt and all variable prompts
|
| 22 |
let promptArray = []
|
| 23 |
+
promptArray.push(pre) // add preprompt to the list of prompts
|
| 24 |
+
|
| 25 |
+
// fill in blanks from our sample prompt and make new prompts
|
| 26 |
blanks.forEach(b => {
|
| 27 |
let p = prompt.replace('[BLANK]', b) // replace the string segment with an idem from the blanksArray
|
| 28 |
+
promptArray.push(p) // add the new prompt to the list we created
|
| 29 |
})
|
| 30 |
+
|
| 31 |
+
// create combined fill prompt
|
| 32 |
let INPUT = promptArray.toString()
|
| 33 |
console.log(promptArray)
|
| 34 |
// let INPUT = pre + prompt // simple concatenated input
|