Spaces:
Running
Running
sarahciston
commited on
Commit
•
8f31274
1
Parent(s):
94f37d8
walkback connection process
Browse files
index.js
CHANGED
@@ -6,7 +6,7 @@ import { pipeline, env } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers
|
|
6 |
env.allowLocalModels = false;
|
7 |
|
8 |
// GLOBAL VARIABLES
|
9 |
-
var PROMPT_INPUT = `The
|
10 |
var OUTPUT_LIST = [] // a blank array to store the results from the model
|
11 |
|
12 |
|
@@ -39,7 +39,6 @@ async function getOutputs(task){
|
|
39 |
|
40 |
console.log(OUTPUT_LIST)
|
41 |
|
42 |
-
|
43 |
return await OUTPUT_LIST
|
44 |
}
|
45 |
|
@@ -69,7 +68,7 @@ new p5(function (p5){
|
|
69 |
}
|
70 |
|
71 |
function makeFields(){
|
72 |
-
PROMPT_INPUT = p5.createInput(
|
73 |
PROMPT_INPUT.size(700)
|
74 |
PROMPT_INPUT.attribute('label', `Write a text prompt with at least one [MASK] that the model will fill in.`)
|
75 |
p5.createP(PROMPT_INPUT.attribute('label'))
|
@@ -80,14 +79,14 @@ new p5(function (p5){
|
|
80 |
let submitButton = p5.createButton("SUBMIT")
|
81 |
submitButton.size(170)
|
82 |
submitButton.class('submit')
|
83 |
-
submitButton.mousePressed(
|
84 |
}
|
85 |
|
86 |
-
async function makeResultsText(){
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
}
|
91 |
|
92 |
});
|
93 |
|
|
|
6 |
env.allowLocalModels = false;
|
7 |
|
8 |
// GLOBAL VARIABLES
|
9 |
+
var PROMPT_INPUT = `The neighbor has a job as a [MASK].` // a field for writing or changing a text value
|
10 |
var OUTPUT_LIST = [] // a blank array to store the results from the model
|
11 |
|
12 |
|
|
|
39 |
|
40 |
console.log(OUTPUT_LIST)
|
41 |
|
|
|
42 |
return await OUTPUT_LIST
|
43 |
}
|
44 |
|
|
|
68 |
}
|
69 |
|
70 |
function makeFields(){
|
71 |
+
PROMPT_INPUT = p5.createInput(``) // access the text via PROMPT_INPUT.value()
|
72 |
PROMPT_INPUT.size(700)
|
73 |
PROMPT_INPUT.attribute('label', `Write a text prompt with at least one [MASK] that the model will fill in.`)
|
74 |
p5.createP(PROMPT_INPUT.attribute('label'))
|
|
|
79 |
let submitButton = p5.createButton("SUBMIT")
|
80 |
submitButton.size(170)
|
81 |
submitButton.class('submit')
|
82 |
+
submitButton.mousePressed(await getOutputs(fillInTask()))
|
83 |
}
|
84 |
|
85 |
+
// async function makeResultsText(){
|
86 |
+
// let resultsText = p5.createElement('h5',"Results:")
|
87 |
+
// let res = await getOutputs(fillInTask())
|
88 |
+
// resultsText.html(str(await res))
|
89 |
+
// }
|
90 |
|
91 |
});
|
92 |
|