Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -107,34 +107,6 @@ function custom(){
|
|
107 |
}
|
108 |
"""
|
109 |
|
110 |
-
"""
|
111 |
-
window.Wait = function (Test, Success, Fail = function () { }, timeout = Number.MAX_SAFE_INTEGER) {
|
112 |
-
let seconds = 0;
|
113 |
-
function Internal() {
|
114 |
-
if (!Test()) {
|
115 |
-
if (seconds >= timeout) {
|
116 |
-
Fail();
|
117 |
-
return;
|
118 |
-
}
|
119 |
-
setTimeout(function () {
|
120 |
-
seconds += 0.01;
|
121 |
-
Internal(...arguments);
|
122 |
-
}, 300);
|
123 |
-
return;
|
124 |
-
}
|
125 |
-
Success();
|
126 |
-
}
|
127 |
-
Internal();
|
128 |
-
};
|
129 |
-
|
130 |
-
Wait(function(){
|
131 |
-
return document.querySelector("div#prompt input")
|
132 |
-
},function(){
|
133 |
-
document.querySelector("div#prompt input").setAttribute("maxlength","38");
|
134 |
-
},function(){});
|
135 |
-
}
|
136 |
-
"""
|
137 |
-
|
138 |
if torch.cuda.is_available():
|
139 |
power_device = "GPU"
|
140 |
else:
|
|
|
107 |
}
|
108 |
"""
|
109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
if torch.cuda.is_available():
|
111 |
power_device = "GPU"
|
112 |
else:
|