Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -368,6 +368,15 @@ list5=[
|
|
| 368 |
'volcano',
|
| 369 |
'wharf',
|
| 370 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 371 |
def fill_phrase(inp1,inp2,inp3,inp4,inp5):
|
| 372 |
if inp1 == "": inp1="-blank-"
|
| 373 |
if inp2 == "": inp2="-blank-"
|
|
@@ -385,9 +394,11 @@ with gr.Blocks() as app:
|
|
| 385 |
inp3=gr.Dropdown(value="",choices=(l for l in list3))
|
| 386 |
inp4=gr.Dropdown(value="",choices=(l for l in list4))
|
| 387 |
inp5=gr.Dropdown(value="",choices=(l for l in list5))
|
| 388 |
-
|
| 389 |
-
|
|
|
|
| 390 |
app.load(fill_phrase,[inp1,inp2,inp3,inp4,inp5],out_box,show_progress=False)
|
|
|
|
| 391 |
inp1.change(fill_phrase,[inp1,inp2,inp3,inp4,inp5],out_box,show_progress=False)
|
| 392 |
inp2.change(fill_phrase,[inp1,inp2,inp3,inp4,inp5],out_box,show_progress=False)
|
| 393 |
inp3.change(fill_phrase,[inp1,inp2,inp3,inp4,inp5],out_box,show_progress=False)
|
|
|
|
| 368 |
'volcano',
|
| 369 |
'wharf',
|
| 370 |
]
|
| 371 |
+
def count_complex():
|
| 372 |
+
cnt1=len(list1)
|
| 373 |
+
cnt2=len(list2)
|
| 374 |
+
cnt3=len(list3)
|
| 375 |
+
cnt4=len(list4)
|
| 376 |
+
cnt5=len(list5)
|
| 377 |
+
out=cnt1*cnt2*cnt3*cnt4*cnt5
|
| 378 |
+
return out
|
| 379 |
+
|
| 380 |
def fill_phrase(inp1,inp2,inp3,inp4,inp5):
|
| 381 |
if inp1 == "": inp1="-blank-"
|
| 382 |
if inp2 == "": inp2="-blank-"
|
|
|
|
| 394 |
inp3=gr.Dropdown(value="",choices=(l for l in list3))
|
| 395 |
inp4=gr.Dropdown(value="",choices=(l for l in list4))
|
| 396 |
inp5=gr.Dropdown(value="",choices=(l for l in list5))
|
| 397 |
+
with gr.Row():
|
| 398 |
+
out_box=gr.Textbox(scale=2)
|
| 399 |
+
cnt_box=gr.Number(scale=1)
|
| 400 |
app.load(fill_phrase,[inp1,inp2,inp3,inp4,inp5],out_box,show_progress=False)
|
| 401 |
+
app.load(count_complex,None,cnt_box)
|
| 402 |
inp1.change(fill_phrase,[inp1,inp2,inp3,inp4,inp5],out_box,show_progress=False)
|
| 403 |
inp2.change(fill_phrase,[inp1,inp2,inp3,inp4,inp5],out_box,show_progress=False)
|
| 404 |
inp3.change(fill_phrase,[inp1,inp2,inp3,inp4,inp5],out_box,show_progress=False)
|