Spaces:
Running
Running
Create handlemodelradio.py
Browse files- handlemodelradio.py +11 -0
handlemodelradio.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|