charliebaby2023 commited on
Commit
97e8ac1
·
verified ·
1 Parent(s): 3dcbd82

Update handlemodelradio.py

Browse files
Files changed (1) hide show
  1. 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)