Update app.py
Browse files
app.py
CHANGED
@@ -117,6 +117,19 @@ js_code = """
|
|
117 |
</script>
|
118 |
"""
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
with gr.Blocks(css="""
|
121 |
label.float.svelte-i3tvor { top:auto!important; bottom: 0; position: absolute; background: rgba(0,0,0,0.0); left: var(--block-label-margin); color: rgba(200,200,200,.7);}
|
122 |
.genbut { max-width: 50px; max-height: 30px; width:150px; height:30px}
|
|
|
117 |
</script>
|
118 |
"""
|
119 |
|
120 |
+
def log_message():
|
121 |
+
logs = ""
|
122 |
+
for i in range(5): # Simulate some logging over time
|
123 |
+
logs += f"Log message {i+1}\n"
|
124 |
+
time.sleep(1)
|
125 |
+
return logs
|
126 |
+
|
127 |
+
with gr.Blocks() as demo:
|
128 |
+
log_output = gr.Textbox(label="Logs", lines=10, interactive=False)
|
129 |
+
log_button = gr.Button("Start Logging")
|
130 |
+
|
131 |
+
log_button.click(log_message, outputs=log_output)
|
132 |
+
|
133 |
with gr.Blocks(css="""
|
134 |
label.float.svelte-i3tvor { top:auto!important; bottom: 0; position: absolute; background: rgba(0,0,0,0.0); left: var(--block-label-margin); color: rgba(200,200,200,.7);}
|
135 |
.genbut { max-width: 50px; max-height: 30px; width:150px; height:30px}
|