Sarah Ciston
commited on
Commit
•
85055fd
1
Parent(s):
877944c
adjust model hyperparams, add buttonsDiv
Browse files
sketch.js
CHANGED
@@ -84,18 +84,21 @@ new p5(function (p5) {
|
|
84 |
addField()
|
85 |
|
86 |
// // BUTTONS // //
|
87 |
-
|
|
|
88 |
// send prompt to model
|
89 |
let submitButton = p5.createButton("SUBMIT")
|
90 |
// submitButton.position(0,500)
|
91 |
submitButton.size(170)
|
92 |
submitButton.class('submit');
|
|
|
93 |
submitButton.mousePressed(getInputs)
|
94 |
|
95 |
// add more blanks to fill in
|
96 |
let addButton = p5.createButton("more blanks")
|
97 |
addButton.size(170)
|
98 |
// addButton.position(220,500)
|
|
|
99 |
addButton.mousePressed(addField)
|
100 |
|
101 |
// TO-DO a model drop down list?
|
@@ -176,6 +179,7 @@ async function runModel(PREPROMPT, PROMPT){
|
|
176 |
|
177 |
// pipeline/transformers version TEST
|
178 |
let pipe = await pipeline('text-generation', 'Xenova/distilgpt2');
|
|
|
179 |
|
180 |
// 'meta-llama/Meta-Llama-3-70B-Instruct'
|
181 |
// 'openai-community/gpt2'
|
@@ -185,7 +189,7 @@ async function runModel(PREPROMPT, PROMPT){
|
|
185 |
max_tokens: 250,
|
186 |
return_full_text: false,
|
187 |
repetition_penalty: 1.5,
|
188 |
-
num_return_sequences:
|
189 |
})
|
190 |
|
191 |
// out = await pipe((PREPROMPT, PROMPT))
|
|
|
84 |
addField()
|
85 |
|
86 |
// // BUTTONS // //
|
87 |
+
let buttonsDiv = p5.createDiv("buttons")
|
88 |
+
buttonsDiv.id('buttonsDiv')
|
89 |
// send prompt to model
|
90 |
let submitButton = p5.createButton("SUBMIT")
|
91 |
// submitButton.position(0,500)
|
92 |
submitButton.size(170)
|
93 |
submitButton.class('submit');
|
94 |
+
submitButton.parent(buttonsDiv)
|
95 |
submitButton.mousePressed(getInputs)
|
96 |
|
97 |
// add more blanks to fill in
|
98 |
let addButton = p5.createButton("more blanks")
|
99 |
addButton.size(170)
|
100 |
// addButton.position(220,500)
|
101 |
+
addButton.parent(buttonsDiv)
|
102 |
addButton.mousePressed(addField)
|
103 |
|
104 |
// TO-DO a model drop down list?
|
|
|
179 |
|
180 |
// pipeline/transformers version TEST
|
181 |
let pipe = await pipeline('text-generation', 'Xenova/distilgpt2');
|
182 |
+
// seems to work with default model distilgpt2 ugh
|
183 |
|
184 |
// 'meta-llama/Meta-Llama-3-70B-Instruct'
|
185 |
// 'openai-community/gpt2'
|
|
|
189 |
max_tokens: 250,
|
190 |
return_full_text: false,
|
191 |
repetition_penalty: 1.5,
|
192 |
+
num_return_sequences: 1 //must be 1 for greedy search
|
193 |
})
|
194 |
|
195 |
// out = await pipe((PREPROMPT, PROMPT))
|
style.css
CHANGED
@@ -112,6 +112,10 @@ button {
|
|
112 |
border: 0;
|
113 |
}
|
114 |
|
|
|
|
|
|
|
|
|
115 |
button:hover {
|
116 |
background-color: #e3e3e3;
|
117 |
}
|
|
|
112 |
border: 0;
|
113 |
}
|
114 |
|
115 |
+
#buttonsDiv {
|
116 |
+
float: left;
|
117 |
+
}
|
118 |
+
|
119 |
button:hover {
|
120 |
background-color: #e3e3e3;
|
121 |
}
|