Spaces:
Runtime error
Runtime error
fix repo_name error
Browse files
src/synthetic_dataset_generator/apps/chat.py
CHANGED
|
@@ -524,77 +524,77 @@ with gr.Blocks() as app:
|
|
| 524 |
label="Distilabel Pipeline Code",
|
| 525 |
)
|
| 526 |
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
|
|
|
| 524 |
label="Distilabel Pipeline Code",
|
| 525 |
)
|
| 526 |
|
| 527 |
+
load_btn.click(
|
| 528 |
+
fn=generate_system_prompt,
|
| 529 |
+
inputs=[dataset_description],
|
| 530 |
+
outputs=[system_prompt],
|
| 531 |
+
show_progress=True,
|
| 532 |
+
).then(
|
| 533 |
+
fn=generate_sample_dataset,
|
| 534 |
+
inputs=[system_prompt, num_turns],
|
| 535 |
+
outputs=[dataframe],
|
| 536 |
+
show_progress=True,
|
| 537 |
+
)
|
| 538 |
|
| 539 |
+
btn_apply_to_sample_dataset.click(
|
| 540 |
+
fn=generate_sample_dataset,
|
| 541 |
+
inputs=[system_prompt, num_turns],
|
| 542 |
+
outputs=[dataframe],
|
| 543 |
+
show_progress=True,
|
| 544 |
+
)
|
| 545 |
|
| 546 |
+
btn_push_to_hub.click(
|
| 547 |
+
fn=validate_argilla_user_workspace_dataset,
|
| 548 |
+
inputs=[repo_name],
|
| 549 |
+
outputs=[success_message],
|
| 550 |
+
show_progress=True,
|
| 551 |
+
).then(
|
| 552 |
+
fn=validate_push_to_hub,
|
| 553 |
+
inputs=[org_name, repo_name],
|
| 554 |
+
outputs=[success_message],
|
| 555 |
+
show_progress=True,
|
| 556 |
+
).success(
|
| 557 |
+
fn=hide_success_message,
|
| 558 |
+
outputs=[success_message],
|
| 559 |
+
show_progress=True,
|
| 560 |
+
).success(
|
| 561 |
+
fn=hide_pipeline_code_visibility,
|
| 562 |
+
inputs=[],
|
| 563 |
+
outputs=[pipeline_code_ui],
|
| 564 |
+
show_progress=True,
|
| 565 |
+
).success(
|
| 566 |
+
fn=push_dataset,
|
| 567 |
+
inputs=[
|
| 568 |
+
org_name,
|
| 569 |
+
repo_name,
|
| 570 |
+
system_prompt,
|
| 571 |
+
num_turns,
|
| 572 |
+
num_rows,
|
| 573 |
+
private,
|
| 574 |
+
temperature,
|
| 575 |
+
pipeline_code,
|
| 576 |
+
],
|
| 577 |
+
outputs=[success_message],
|
| 578 |
+
show_progress=True,
|
| 579 |
+
).success(
|
| 580 |
+
fn=show_success_message,
|
| 581 |
+
inputs=[org_name, repo_name],
|
| 582 |
+
outputs=[success_message],
|
| 583 |
+
).success(
|
| 584 |
+
fn=generate_pipeline_code,
|
| 585 |
+
inputs=[system_prompt, num_turns, num_rows],
|
| 586 |
+
outputs=[pipeline_code],
|
| 587 |
+
).success(
|
| 588 |
+
fn=show_pipeline_code_visibility,
|
| 589 |
+
inputs=[],
|
| 590 |
+
outputs=[pipeline_code_ui],
|
| 591 |
+
)
|
| 592 |
+
gr.on(
|
| 593 |
+
triggers=[clear_btn_part.click, clear_btn_full.click],
|
| 594 |
+
fn=lambda _: ("", "", 1, _get_dataframe()),
|
| 595 |
+
inputs=[dataframe],
|
| 596 |
+
outputs=[system_prompt, num_turns, dataframe],
|
| 597 |
+
)
|
| 598 |
+
app.load(fn=get_org_dropdown, outputs=[org_name])
|
| 599 |
+
app.load(fn=get_random_repo_name, outputs=[repo_name])
|
| 600 |
+
app.load(fn=swap_visibility, outputs=main_ui)
|