Spaces:
Running
Running
Update handlemodelradio.py
Browse files- handlemodelradio.py +4 -5
handlemodelradio.py
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
def extend_choices(choices):
|
4 |
return choices[:num_models] + (num_models - len(choices[:num_models])) * ['NA']
|
5 |
-
def update_imgbox(choices):
|
6 |
choices_plus = extend_choices(choices[:num_models])
|
7 |
return [gr.Image(None, label=m, visible=(m!='NA')) for m in choices_plus]
|
8 |
-
def random_choices():
|
9 |
import random
|
10 |
random.seed()
|
11 |
return random.choices(models, k=num_models)
|
|
|
1 |
+
|
2 |
+
def extend_choices(choices,num_models):
|
|
|
3 |
return choices[:num_models] + (num_models - len(choices[:num_models])) * ['NA']
|
4 |
+
def update_imgbox(choices,num_models):
|
5 |
choices_plus = extend_choices(choices[:num_models])
|
6 |
return [gr.Image(None, label=m, visible=(m!='NA')) for m in choices_plus]
|
7 |
+
def random_choices(num_models):
|
8 |
import random
|
9 |
random.seed()
|
10 |
return random.choices(models, k=num_models)
|