Spaces:
Sleeping
Sleeping
test
Browse files
app.py
CHANGED
@@ -26,11 +26,9 @@ queue_size = 0
|
|
26 |
def displayTextBox():
|
27 |
global queue_size
|
28 |
if queue_size > 4:
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
# # return [gr.update(visible=True), gr.update(visible=False)]
|
33 |
-
# return gr.update(elem_id='txtGreenStyle')
|
34 |
|
35 |
|
36 |
def set_msg():
|
@@ -138,7 +136,8 @@ with gr.Blocks(css=css) as demo:
|
|
138 |
gr.Markdown(md)
|
139 |
|
140 |
textBoxGreen = gr.Textbox(set_msg, every=3, label='Real-time Jobs in Queue', elem_id='txtGreenStyle', visible=True)
|
141 |
-
|
|
|
142 |
|
143 |
with gr.Tab("Text-to-Image"):
|
144 |
with gr.Row(visible=True) as text_to_image:
|
@@ -179,3 +178,4 @@ with gr.Blocks(css=css) as demo:
|
|
179 |
gr.Markdown(legal, elem_id='mdStyle')
|
180 |
|
181 |
demo.queue(max_size=int(os.environ["max_job_size"]), concurrency_count=int(os.environ["max_job_size"])).launch(debug=True, show_api=False)
|
|
|
|
26 |
def displayTextBox():
|
27 |
global queue_size
|
28 |
if queue_size > 4:
|
29 |
+
return [gr.update(visible=False), gr.update(visible=True)]
|
30 |
+
elif queue_size <= 4:
|
31 |
+
return [gr.update(visible=True), gr.update(visible=False)]
|
|
|
|
|
32 |
|
33 |
|
34 |
def set_msg():
|
|
|
136 |
gr.Markdown(md)
|
137 |
|
138 |
textBoxGreen = gr.Textbox(set_msg, every=3, label='Real-time Jobs in Queue', elem_id='txtGreenStyle', visible=True)
|
139 |
+
textBoxOrange = gr.Textbox(set_msg, every=3, label='Real-time Jobs in Queue', elem_id='txtOrangeStyle', visible=False)
|
140 |
+
textBoxGreen.change(displayTextBox, outputs = [textBoxGreen, textBoxOrange])
|
141 |
|
142 |
with gr.Tab("Text-to-Image"):
|
143 |
with gr.Row(visible=True) as text_to_image:
|
|
|
178 |
gr.Markdown(legal, elem_id='mdStyle')
|
179 |
|
180 |
demo.queue(max_size=int(os.environ["max_job_size"]), concurrency_count=int(os.environ["max_job_size"])).launch(debug=True, show_api=False)
|
181 |
+
|