aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-10-02 21:33:32 +0300
committerGitHub <noreply@github.com>2022-10-02 21:33:32 +0300
commitad0503c1b59de0654e3b34c72e81a3c410ba7788 (patch)
tree39c3221e99ca90b7238057bc555c5b4d63fcf960 /javascript
parent852fd90c0dcda9cb5fbbfdf0c7308ce58034935c (diff)
parent688c4a914a6cb152b5f5e4088bace709ed3dcc35 (diff)
Merge pull request #1454 from AUTOMATIC1111/1404-script-reload-without-restart
Gradio+custom script+js+css reload without model reloading
Diffstat (limited to 'javascript')
-rw-r--r--javascript/ui.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/javascript/ui.js b/javascript/ui.js
index f94ed081..b1053201 100644
--- a/javascript/ui.js
+++ b/javascript/ui.js
@@ -218,10 +218,16 @@ function update_token_counter(button_id) {
clearTimeout(token_timeout);
token_timeout = setTimeout(() => gradioApp().getElementById(button_id)?.click(), wait_time);
}
+
function submit_prompt(event, generate_button_id) {
if (event.altKey && event.keyCode === 13) {
event.preventDefault();
gradioApp().getElementById(generate_button_id).click();
return;
}
-} \ No newline at end of file
+}
+
+function restart_reload(){
+ document.body.innerHTML='<h1 style="font-family:monospace;margin-top:20%;color:lightgray;text-align:center;">Reloading...</h1>';
+ setTimeout(function(){location.reload()},2000)
+}