sarahciston commited on
Commit
eef4c4d
·
verified ·
1 Parent(s): 00a54b5

fix prompt concatenation loop

Browse files
Files changed (1) hide show
  1. sketch.js +6 -3
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(pre + p) // add the new prompt to the list we created
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