Sarah Ciston commited on
Commit
d3ccb32
·
1 Parent(s): cb1ef38

form check

Browse files
Files changed (1) hide show
  1. sketch.js +38 -32
sketch.js CHANGED
@@ -27,33 +27,33 @@ var PROMPT = `${promptInput}`
27
  // for num of inputs put in list
28
  var inputArray = [`${maskInputA}`, `${maskInputB}`, `${maskInputC}`]
29
 
30
- async function runModel(){
31
- // Chat completion API
32
- const out = await inference.chatCompletion({
33
- model: MODELNAME,
34
- // model: "google/gemma-2-9b",
35
- messages: [{ role: "user", content: PREPROMPT + PROMPT }],
36
- max_tokens: 100
37
- });
38
-
39
- // let out = await pipe(PREPROMPT + PROMPT)
40
- // let out = await pipe(PREPROMPT + PROMPT, {
41
- // max_new_tokens: 250,
42
- // temperature: 0.9,
43
- // // return_full_text: False,
44
- // repetition_penalty: 1.5,
45
- // // no_repeat_ngram_size: 2,
46
- // // num_beams: 2,
47
- // num_return_sequences: 1
48
- // });
49
- console.log(out)
50
-
51
- var result = await out.choices[0].message.content
52
- // var result = await out[0].generated_text
53
- console.log(result);
54
-
55
- return result
56
- }
57
 
58
 
59
  // Reference the elements that we will need
@@ -214,17 +214,23 @@ new p5(function(p5){
214
  promptButton = p5.createButton("GO").position(0, 340);
215
  promptButton.position(0, 340);
216
  promptButton.elt.style.fontSize = "15px";
217
- promptButton.mousePressed(await runModel)
218
- promptInput.changed(await runModel)
219
- maskInputA.changed(await runModel)
220
- maskInputB.changed(await runModel)
221
- maskInputC.changed(await runModel)
222
 
223
  // describe(``)
224
  // TO-DO alt-text description
225
 
226
  }
227
 
 
 
 
 
 
 
228
  // var result = promptButton.mousePressed(runModel) = function(){
229
  // // listens for the button to be clicked
230
  // // run the prompt through the model here
 
27
  // for num of inputs put in list
28
  var inputArray = [`${maskInputA}`, `${maskInputB}`, `${maskInputC}`]
29
 
30
+ // async function runModel(){
31
+ // // Chat completion API
32
+ // const out = await inference.chatCompletion({
33
+ // model: MODELNAME,
34
+ // // model: "google/gemma-2-9b",
35
+ // messages: [{ role: "user", content: PREPROMPT + PROMPT }],
36
+ // max_tokens: 100
37
+ // });
38
+
39
+ // // let out = await pipe(PREPROMPT + PROMPT)
40
+ // // let out = await pipe(PREPROMPT + PROMPT, {
41
+ // // max_new_tokens: 250,
42
+ // // temperature: 0.9,
43
+ // // // return_full_text: False,
44
+ // // repetition_penalty: 1.5,
45
+ // // // no_repeat_ngram_size: 2,
46
+ // // // num_beams: 2,
47
+ // // num_return_sequences: 1
48
+ // // });
49
+ // console.log(out)
50
+
51
+ // var result = await out.choices[0].message.content
52
+ // // var result = await out[0].generated_text
53
+ // console.log(result);
54
+
55
+ // return result
56
+ // }
57
 
58
 
59
  // Reference the elements that we will need
 
214
  promptButton = p5.createButton("GO").position(0, 340);
215
  promptButton.position(0, 340);
216
  promptButton.elt.style.fontSize = "15px";
217
+ promptButton.mousePressed(test)
218
+ promptInput.changed(test)
219
+ maskInputA.changed(test)
220
+ maskInputB.changed(test)
221
+ maskInputC.changed(test)
222
 
223
  // describe(``)
224
  // TO-DO alt-text description
225
 
226
  }
227
 
228
+ function test(){
229
+ console.log('did something')
230
+ console.log(PROMPT)
231
+ console.log(inputArray)
232
+ }
233
+
234
  // var result = promptButton.mousePressed(runModel) = function(){
235
  // // listens for the button to be clicked
236
  // // run the prompt through the model here