Spaces:
Running
Running
Commit
·
357da31
1
Parent(s):
aab6b21
Update app.py
Browse files
app.py
CHANGED
|
@@ -102,7 +102,8 @@ start_work = """async() => {
|
|
| 102 |
texts = window['gradioEl'].querySelectorAll('textarea');
|
| 103 |
text0 = texts[0];
|
| 104 |
text1 = texts[1];
|
| 105 |
-
if (window['doCheckPrompt']
|
|
|
|
| 106 |
window['doCheckPrompt'] = 1;
|
| 107 |
window['prevPrompt'] = text1.value;
|
| 108 |
for (var i = 2; i < texts.length; i++) {
|
|
@@ -110,12 +111,9 @@ start_work = """async() => {
|
|
| 110 |
texts[i].dispatchEvent(new Event('input', { bubbles: true }));
|
| 111 |
}
|
| 112 |
setTimeout(function() {
|
| 113 |
-
//text1 = window['gradioEl'].querySelectorAll('textarea')[1];
|
| 114 |
-
|
| 115 |
btns = window['gradioEl'].querySelectorAll('button');
|
| 116 |
for (var i = 0; i < btns.length; i++) {
|
| 117 |
if (btns[i].innerText == 'Submit') {
|
| 118 |
-
//btns[i].focus();
|
| 119 |
btns[i].click();
|
| 120 |
}
|
| 121 |
}
|
|
|
|
| 102 |
texts = window['gradioEl'].querySelectorAll('textarea');
|
| 103 |
text0 = texts[0];
|
| 104 |
text1 = texts[1];
|
| 105 |
+
if (window['doCheckPrompt'] === 0 && window['prevPrompt'] !== text1.value) {
|
| 106 |
+
console.log('_____new prompt____');
|
| 107 |
window['doCheckPrompt'] = 1;
|
| 108 |
window['prevPrompt'] = text1.value;
|
| 109 |
for (var i = 2; i < texts.length; i++) {
|
|
|
|
| 111 |
texts[i].dispatchEvent(new Event('input', { bubbles: true }));
|
| 112 |
}
|
| 113 |
setTimeout(function() {
|
|
|
|
|
|
|
| 114 |
btns = window['gradioEl'].querySelectorAll('button');
|
| 115 |
for (var i = 0; i < btns.length; i++) {
|
| 116 |
if (btns[i].innerText == 'Submit') {
|
|
|
|
| 117 |
btns[i].click();
|
| 118 |
}
|
| 119 |
}
|