Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -218,16 +218,18 @@ body {
|
|
218 |
|
219 |
# Interface Gradio
|
220 |
# Interface Gradio
|
221 |
-
def
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
|
|
|
|
231 |
|
232 |
def demo():
|
233 |
custom_css = """
|
@@ -237,7 +239,6 @@ def demo():
|
|
237 |
footer {
|
238 |
display: none !important;
|
239 |
}
|
240 |
-
/* Ajustes do container principal */
|
241 |
.gradio-container {
|
242 |
margin-top: 0 !important;
|
243 |
}
|
@@ -255,7 +256,7 @@ def demo():
|
|
255 |
with gr.Row():
|
256 |
cover_html = gr.HTML("")
|
257 |
toggle_btn = gr.Button("Ocultar Barra", elem_classes="cover-button")
|
258 |
-
|
259 |
|
260 |
# Estados do sistema
|
261 |
vector_db = gr.State()
|
@@ -339,24 +340,10 @@ def demo():
|
|
339 |
|
340 |
# Eventos do sistema
|
341 |
toggle_btn.click(
|
342 |
-
fn=
|
343 |
-
inputs=[],
|
344 |
-
outputs=[cover_html, toggle_btn],
|
345 |
show_progress=False
|
346 |
-
).then(
|
347 |
-
fn=lambda: True,
|
348 |
-
outputs=[is_covered]
|
349 |
-
)
|
350 |
-
|
351 |
-
toggle_btn.click(
|
352 |
-
fn=remove_cover,
|
353 |
-
inputs=[],
|
354 |
-
outputs=[cover_html, toggle_btn],
|
355 |
-
show_progress=False,
|
356 |
-
trigger_mode=lambda s: s
|
357 |
-
).then(
|
358 |
-
fn=lambda: False,
|
359 |
-
outputs=[is_covered]
|
360 |
)
|
361 |
|
362 |
# Eventos de pré-processamento
|
|
|
218 |
|
219 |
# Interface Gradio
|
220 |
# Interface Gradio
|
221 |
+
def toggle_bar(is_visible):
|
222 |
+
if is_visible:
|
223 |
+
cover_html = """
|
224 |
+
<div style="position: fixed; top: 0; left: 0; right: 0; height: 64px;
|
225 |
+
background: white; z-index: 9999; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">
|
226 |
+
</div>
|
227 |
+
"""
|
228 |
+
btn_text = "Mostrar Barra"
|
229 |
+
else:
|
230 |
+
cover_html = ""
|
231 |
+
btn_text = "Ocultar Barra"
|
232 |
+
return cover_html, btn_text, not is_visible
|
233 |
|
234 |
def demo():
|
235 |
custom_css = """
|
|
|
239 |
footer {
|
240 |
display: none !important;
|
241 |
}
|
|
|
242 |
.gradio-container {
|
243 |
margin-top: 0 !important;
|
244 |
}
|
|
|
256 |
with gr.Row():
|
257 |
cover_html = gr.HTML("")
|
258 |
toggle_btn = gr.Button("Ocultar Barra", elem_classes="cover-button")
|
259 |
+
is_visible = gr.State(False)
|
260 |
|
261 |
# Estados do sistema
|
262 |
vector_db = gr.State()
|
|
|
340 |
|
341 |
# Eventos do sistema
|
342 |
toggle_btn.click(
|
343 |
+
fn=toggle_bar,
|
344 |
+
inputs=[is_visible],
|
345 |
+
outputs=[cover_html, toggle_btn, is_visible],
|
346 |
show_progress=False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
)
|
348 |
|
349 |
# Eventos de pré-processamento
|