hide pipeline ui each time it generates
Browse files
src/distilabel_dataset_generator/apps/eval.py
CHANGED
@@ -577,9 +577,12 @@ def push_dataset(
|
|
577 |
return ""
|
578 |
|
579 |
|
580 |
-
def
|
581 |
return {pipeline_code_ui: gr.Accordion(visible=True)}
|
582 |
|
|
|
|
|
|
|
583 |
|
584 |
######################
|
585 |
# Gradio UI
|
@@ -747,6 +750,10 @@ with gr.Blocks() as app:
|
|
747 |
)
|
748 |
|
749 |
btn_push_to_hub.click(
|
|
|
|
|
|
|
|
|
750 |
fn=validate_argilla_user_workspace_dataset,
|
751 |
inputs=[repo_name],
|
752 |
outputs=[success_message],
|
@@ -795,7 +802,7 @@ with gr.Blocks() as app:
|
|
795 |
],
|
796 |
outputs=[pipeline_code],
|
797 |
).success(
|
798 |
-
fn=
|
799 |
inputs=[],
|
800 |
outputs=[pipeline_code_ui],
|
801 |
)
|
|
|
577 |
return ""
|
578 |
|
579 |
|
580 |
+
def show_pipeline_code_visibility():
|
581 |
return {pipeline_code_ui: gr.Accordion(visible=True)}
|
582 |
|
583 |
+
def hide_pipeline_code_visibility():
|
584 |
+
return {pipeline_code_ui: gr.Accordion(visible=False)}
|
585 |
+
|
586 |
|
587 |
######################
|
588 |
# Gradio UI
|
|
|
750 |
)
|
751 |
|
752 |
btn_push_to_hub.click(
|
753 |
+
fn=hide_pipeline_code_visibility,
|
754 |
+
inputs=[],
|
755 |
+
outputs=[pipeline_code_ui],
|
756 |
+
).then(
|
757 |
fn=validate_argilla_user_workspace_dataset,
|
758 |
inputs=[repo_name],
|
759 |
outputs=[success_message],
|
|
|
802 |
],
|
803 |
outputs=[pipeline_code],
|
804 |
).success(
|
805 |
+
fn=show_pipeline_code_visibility,
|
806 |
inputs=[],
|
807 |
outputs=[pipeline_code_ui],
|
808 |
)
|
src/distilabel_dataset_generator/apps/sft.py
CHANGED
@@ -337,10 +337,14 @@ def push_dataset(
|
|
337 |
return ""
|
338 |
|
339 |
|
340 |
-
def
|
341 |
return {pipeline_code_ui: gr.Accordion(visible=True)}
|
342 |
|
343 |
|
|
|
|
|
|
|
|
|
344 |
######################
|
345 |
# Gradio UI
|
346 |
######################
|
@@ -470,6 +474,10 @@ with gr.Blocks(css=_LOGGED_OUT_CSS) as app:
|
|
470 |
)
|
471 |
|
472 |
btn_push_to_hub.click(
|
|
|
|
|
|
|
|
|
473 |
fn=validate_argilla_user_workspace_dataset,
|
474 |
inputs=[repo_name],
|
475 |
outputs=[success_message],
|
@@ -504,7 +512,7 @@ with gr.Blocks(css=_LOGGED_OUT_CSS) as app:
|
|
504 |
inputs=[system_prompt, num_turns, num_rows],
|
505 |
outputs=[pipeline_code],
|
506 |
).success(
|
507 |
-
fn=
|
508 |
inputs=[],
|
509 |
outputs=[pipeline_code_ui],
|
510 |
)
|
|
|
337 |
return ""
|
338 |
|
339 |
|
340 |
+
def show_pipeline_code_visibility():
|
341 |
return {pipeline_code_ui: gr.Accordion(visible=True)}
|
342 |
|
343 |
|
344 |
+
def hide_pipeline_code_visibility():
|
345 |
+
return {pipeline_code_ui: gr.Accordion(visible=False)}
|
346 |
+
|
347 |
+
|
348 |
######################
|
349 |
# Gradio UI
|
350 |
######################
|
|
|
474 |
)
|
475 |
|
476 |
btn_push_to_hub.click(
|
477 |
+
fn=hide_pipeline_code_visibility,
|
478 |
+
inputs=[],
|
479 |
+
outputs=[pipeline_code_ui],
|
480 |
+
).then(
|
481 |
fn=validate_argilla_user_workspace_dataset,
|
482 |
inputs=[repo_name],
|
483 |
outputs=[success_message],
|
|
|
512 |
inputs=[system_prompt, num_turns, num_rows],
|
513 |
outputs=[pipeline_code],
|
514 |
).success(
|
515 |
+
fn=show_pipeline_code_visibility,
|
516 |
inputs=[],
|
517 |
outputs=[pipeline_code_ui],
|
518 |
)
|
src/distilabel_dataset_generator/apps/textcat.py
CHANGED
@@ -318,10 +318,15 @@ def validate_input_labels(labels):
|
|
318 |
def update_max_num_labels(labels):
|
319 |
return gr.update(maximum=len(labels) if labels else 1)
|
320 |
|
321 |
-
|
|
|
322 |
return {pipeline_code_ui: gr.Accordion(visible=True)}
|
323 |
|
324 |
|
|
|
|
|
|
|
|
|
325 |
######################
|
326 |
# Gradio UI
|
327 |
######################
|
@@ -494,6 +499,10 @@ with gr.Blocks(css=_LOGGED_OUT_CSS) as app:
|
|
494 |
)
|
495 |
|
496 |
btn_push_to_hub.click(
|
|
|
|
|
|
|
|
|
497 |
fn=validate_argilla_user_workspace_dataset,
|
498 |
inputs=[repo_name],
|
499 |
outputs=[success_message],
|
@@ -538,7 +547,7 @@ with gr.Blocks(css=_LOGGED_OUT_CSS) as app:
|
|
538 |
],
|
539 |
outputs=[pipeline_code],
|
540 |
).success(
|
541 |
-
fn=
|
542 |
inputs=[],
|
543 |
outputs=[pipeline_code_ui],
|
544 |
)
|
|
|
318 |
def update_max_num_labels(labels):
|
319 |
return gr.update(maximum=len(labels) if labels else 1)
|
320 |
|
321 |
+
|
322 |
+
def show_pipeline_code_visibility():
|
323 |
return {pipeline_code_ui: gr.Accordion(visible=True)}
|
324 |
|
325 |
|
326 |
+
def hide_pipeline_code_visibility():
|
327 |
+
return {pipeline_code_ui: gr.Accordion(visible=False)}
|
328 |
+
|
329 |
+
|
330 |
######################
|
331 |
# Gradio UI
|
332 |
######################
|
|
|
499 |
)
|
500 |
|
501 |
btn_push_to_hub.click(
|
502 |
+
fn=hide_pipeline_code_visibility,
|
503 |
+
inputs=[],
|
504 |
+
outputs=[pipeline_code_ui],
|
505 |
+
).then(
|
506 |
fn=validate_argilla_user_workspace_dataset,
|
507 |
inputs=[repo_name],
|
508 |
outputs=[success_message],
|
|
|
547 |
],
|
548 |
outputs=[pipeline_code],
|
549 |
).success(
|
550 |
+
fn=show_pipeline_code_visibility,
|
551 |
inputs=[],
|
552 |
outputs=[pipeline_code_ui],
|
553 |
)
|