Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -147,6 +147,7 @@ opt.colors = [
|
|
147 |
# '#FECAC0',
|
148 |
]
|
149 |
opt.excluded_keys = ['inpainting_mode', 'is_running', 'active_palettes', 'current_palette', 'model']
|
|
|
150 |
|
151 |
|
152 |
### Event handlers
|
@@ -1042,6 +1043,12 @@ async () => {{
|
|
1042 |
}}, {int(opt.run_time * 1000 * 0.75)});
|
1043 |
}};
|
1044 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1045 |
var deadlineTextFinished = function () {{
|
1046 |
var el = jQuery('.deadline-timer');
|
1047 |
var html = 'Done! Retry?';
|
@@ -1051,15 +1058,17 @@ async () => {{
|
|
1051 |
function timer(totalTime, deadline) {{
|
1052 |
var time = totalTime * 1000;
|
1053 |
var dayDuration = time / deadline;
|
1054 |
-
var actualDay = deadline;
|
1055 |
|
1056 |
var timer = setInterval(countTime, dayDuration);
|
1057 |
|
1058 |
function countTime() {{
|
1059 |
--actualDay;
|
1060 |
-
|
1061 |
-
|
1062 |
-
if (actualDay
|
|
|
|
|
1063 |
clearInterval(timer);
|
1064 |
// jQuery('.deadline-timer .day').text(deadline);
|
1065 |
deadlineTextFinished();
|
@@ -1077,7 +1086,7 @@ async () => {{
|
|
1077 |
|
1078 |
var runAnimation = function() {{
|
1079 |
timer(animationTime, days);
|
1080 |
-
|
1081 |
deadlineText();
|
1082 |
|
1083 |
console.log('begin interval', animationTime * 1000);
|
|
|
147 |
# '#FECAC0',
|
148 |
]
|
149 |
opt.excluded_keys = ['inpainting_mode', 'is_running', 'active_palettes', 'current_palette', 'model']
|
150 |
+
opt.prep_time = 12
|
151 |
|
152 |
|
153 |
### Event handlers
|
|
|
1043 |
}}, {int(opt.run_time * 1000 * 0.75)});
|
1044 |
}};
|
1045 |
|
1046 |
+
var deadlineTextBegin = function () {{
|
1047 |
+
var el = jQuery('.deadline-timer');
|
1048 |
+
var html = 'Preparing...';
|
1049 |
+
el.html(html);
|
1050 |
+
}};
|
1051 |
+
|
1052 |
var deadlineTextFinished = function () {{
|
1053 |
var el = jQuery('.deadline-timer');
|
1054 |
var html = 'Done! Retry?';
|
|
|
1058 |
function timer(totalTime, deadline) {{
|
1059 |
var time = totalTime * 1000;
|
1060 |
var dayDuration = time / deadline;
|
1061 |
+
var actualDay = deadline + {opt.prep_time};
|
1062 |
|
1063 |
var timer = setInterval(countTime, dayDuration);
|
1064 |
|
1065 |
function countTime() {{
|
1066 |
--actualDay;
|
1067 |
+
if (actualDay > deadline) {{
|
1068 |
+
deadlineTextBegin();
|
1069 |
+
}} else if (actualDay > 0) {{
|
1070 |
+
jQuery('.deadline-timer .day').text(actualDay - {opt.prep_time});
|
1071 |
+
}} else {{
|
1072 |
clearInterval(timer);
|
1073 |
// jQuery('.deadline-timer .day').text(deadline);
|
1074 |
deadlineTextFinished();
|
|
|
1086 |
|
1087 |
var runAnimation = function() {{
|
1088 |
timer(animationTime, days);
|
1089 |
+
remation();
|
1090 |
deadlineText();
|
1091 |
|
1092 |
console.log('begin interval', animationTime * 1000);
|