Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,8 @@ from datetime import datetime
|
|
| 5 |
|
| 6 |
now2 = 0
|
| 7 |
nb_models=16
|
|
|
|
|
|
|
| 8 |
|
| 9 |
def split_models(models,nb_models):
|
| 10 |
models_temp=[]
|
|
@@ -80,6 +82,12 @@ def choice_group_d(var_Test):
|
|
| 80 |
stop_button.click(lambda s: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
|
| 81 |
return gen_event
|
| 82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
def gen_fn(model_str, prompt):
|
| 85 |
if model_str == 'NA':
|
|
@@ -105,7 +113,7 @@ def make_me():
|
|
| 105 |
with gr.Row():
|
| 106 |
"""output = [gr.Image(label=m, min_width=170, height=170) for m in default_models]
|
| 107 |
current_models = [gr.Textbox(m, visible=False) for m in default_models]"""
|
| 108 |
-
choices=models_test[0]
|
| 109 |
output = [gr.Image(label=m, min_width=170, height=170) for m in choices]
|
| 110 |
current_models = [gr.Textbox(m, visible=False) for m in choices]
|
| 111 |
|
|
@@ -125,6 +133,11 @@ def make_me():
|
|
| 125 |
group_model_choice.change(choice_group_b,group_model_choice,output)
|
| 126 |
group_model_choice.change(choice_group_c,group_model_choice,current_models)
|
| 127 |
"""group_model_choice.change(choice_group_d,(gen_button,stop_button,output,current_models),gen_event)"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
with gr.Row():
|
| 129 |
gr.HTML("""
|
| 130 |
<div class="footer">
|
|
|
|
| 5 |
|
| 6 |
now2 = 0
|
| 7 |
nb_models=16
|
| 8 |
+
global p="DemiPotoPass1988"
|
| 9 |
+
global test_p=False
|
| 10 |
|
| 11 |
def split_models(models,nb_models):
|
| 12 |
models_temp=[]
|
|
|
|
| 82 |
stop_button.click(lambda s: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
|
| 83 |
return gen_event
|
| 84 |
|
| 85 |
+
def test_pass(test_pass):
|
| 86 |
+
print(test_pass)
|
| 87 |
+
if test_pass==p:
|
| 88 |
+
test_p=True
|
| 89 |
+
print(test_p)
|
| 90 |
+
|
| 91 |
|
| 92 |
def gen_fn(model_str, prompt):
|
| 93 |
if model_str == 'NA':
|
|
|
|
| 113 |
with gr.Row():
|
| 114 |
"""output = [gr.Image(label=m, min_width=170, height=170) for m in default_models]
|
| 115 |
current_models = [gr.Textbox(m, visible=False) for m in default_models]"""
|
| 116 |
+
choices=models_test[0][0]
|
| 117 |
output = [gr.Image(label=m, min_width=170, height=170) for m in choices]
|
| 118 |
current_models = [gr.Textbox(m, visible=False) for m in choices]
|
| 119 |
|
|
|
|
| 133 |
group_model_choice.change(choice_group_b,group_model_choice,output)
|
| 134 |
group_model_choice.change(choice_group_c,group_model_choice,current_models)
|
| 135 |
"""group_model_choice.change(choice_group_d,(gen_button,stop_button,output,current_models),gen_event)"""
|
| 136 |
+
with gr.Row():
|
| 137 |
+
txt_input_p = gr.Textbox(label='test', lines=1, width=300, max_height=100)
|
| 138 |
+
|
| 139 |
+
test_button = gr.Button('test', width=30, height=10)
|
| 140 |
+
test_button.click(test_pass(txt_input_p.value))
|
| 141 |
with gr.Row():
|
| 142 |
gr.HTML("""
|
| 143 |
<div class="footer">
|