@@ -39,7 +39,7 @@ export default {
39
39
attached_cbs : undefined ,
40
40
model_version : " " ,
41
41
nb_its: 0 ,
42
- times : [],
42
+ iter_times : [],
43
43
generation_loop: undefined
44
44
};
45
45
},
@@ -144,8 +144,8 @@ export default {
144
144
if (this .attached_cbs .on_progress ){
145
145
if (p >= 0 ){
146
146
this .generation_state_msg = iter_time/ 1000 + " s/it" ;
147
- this .times .push (iter_time);
148
- let median = this .times .sort ((a , b ) => a - b)[Math .floor (this .times .length / 2 )];
147
+ this .iter_times .push (iter_time);
148
+ let median = this .iter_times .sort ((a , b ) => a - b)[Math .floor (this .iter_times .length / 2 )];
149
149
let time_remaining = moment .duration (median* ((100 - p)* this .nb_its / 100 ));
150
150
151
151
this .remaining_times = compute_time_remaining (time_remaining);
@@ -168,6 +168,7 @@ export default {
168
168
169
169
interupt (){
170
170
send_to_py (" t2im __stop__" )
171
+ clearInterval (this .generation_loop );
171
172
},
172
173
173
174
text_to_img (prompt_params , callbacks , generated_by ){
@@ -199,7 +200,7 @@ export default {
199
200
this .attached_cbs = callbacks;
200
201
this .generation_state_msg = " "
201
202
this .remaining_times = " "
202
- this .times = []
203
+ this .iter_times = []
203
204
this .nb_its = prompt_params .ddim_steps || 25
204
205
send_to_py (" t2im " + JSON .stringify (prompt_params))
205
206
}
0 commit comments