Spaces:
Runtime error
Runtime error
Merge pull request #34 from sebaxakerhtc/Fix_gradioUI
Browse files
src/synthetic_dataset_generator/apps/rag.py
CHANGED
|
@@ -678,39 +678,38 @@ with gr.Blocks() as app:
|
|
| 678 |
gr.HTML(value="<hr>")
|
| 679 |
gr.Markdown(value="## 2. Configure your task")
|
| 680 |
with gr.Row(equal_height=True):
|
| 681 |
-
with gr.
|
| 682 |
-
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
| 690 |
-
|
| 691 |
-
|
| 692 |
-
|
| 693 |
-
|
| 694 |
-
|
| 695 |
-
|
| 696 |
-
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
| 702 |
-
|
| 703 |
-
|
| 704 |
-
|
| 705 |
-
|
| 706 |
-
"Save", variant="primary"
|
| 707 |
-
)
|
| 708 |
-
with gr.Column(scale=3):
|
| 709 |
-
dataframe = gr.Dataframe(
|
| 710 |
-
headers=["context", "question", "response"],
|
| 711 |
-
wrap=True,
|
| 712 |
-
interactive=False,
|
| 713 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 714 |
|
| 715 |
gr.HTML(value="<hr>")
|
| 716 |
gr.Markdown(value="## 3. Generate your dataset")
|
|
|
|
| 678 |
gr.HTML(value="<hr>")
|
| 679 |
gr.Markdown(value="## 2. Configure your task")
|
| 680 |
with gr.Row(equal_height=True):
|
| 681 |
+
with gr.Column(scale=2):
|
| 682 |
+
system_prompt = gr.Textbox(
|
| 683 |
+
label="System prompt",
|
| 684 |
+
placeholder="You are a helpful assistant.",
|
| 685 |
+
visible=False,
|
| 686 |
+
)
|
| 687 |
+
document_column = gr.Dropdown(
|
| 688 |
+
label="Document Column",
|
| 689 |
+
info="Select the document column to generate the RAG dataset",
|
| 690 |
+
choices=["Load your data first in step 1."],
|
| 691 |
+
value="Load your data first in step 1.",
|
| 692 |
+
interactive=False,
|
| 693 |
+
multiselect=False,
|
| 694 |
+
allow_custom_value=False,
|
| 695 |
+
)
|
| 696 |
+
retrieval_reranking = gr.CheckboxGroup(
|
| 697 |
+
choices=[("Retrieval", "Retrieval"), ("Reranking", "Reranking")],
|
| 698 |
+
type="value",
|
| 699 |
+
label="Data for RAG",
|
| 700 |
+
info="Indicate the additional data you want to generate for RAG.",
|
| 701 |
+
)
|
| 702 |
+
with gr.Row():
|
| 703 |
+
clear_btn_full = gr.Button("Clear", variant="secondary")
|
| 704 |
+
btn_apply_to_sample_dataset = gr.Button(
|
| 705 |
+
"Save", variant="primary"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 706 |
)
|
| 707 |
+
with gr.Column(scale=3):
|
| 708 |
+
dataframe = gr.Dataframe(
|
| 709 |
+
headers=["context", "question", "response"],
|
| 710 |
+
wrap=True,
|
| 711 |
+
interactive=False,
|
| 712 |
+
)
|
| 713 |
|
| 714 |
gr.HTML(value="<hr>")
|
| 715 |
gr.Markdown(value="## 3. Generate your dataset")
|
src/synthetic_dataset_generator/apps/textcat.py
CHANGED
|
@@ -459,61 +459,60 @@ with gr.Blocks() as app:
|
|
| 459 |
gr.HTML("<hr>")
|
| 460 |
gr.Markdown("## 2. Configure your dataset")
|
| 461 |
with gr.Row(equal_height=True):
|
| 462 |
-
with gr.
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 509 |
)
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
btn_apply_to_sample_dataset = gr.Button(
|
| 513 |
-
"Save", variant="primary"
|
| 514 |
-
)
|
| 515 |
-
with gr.Column(scale=3):
|
| 516 |
-
dataframe = _get_dataframe()
|
| 517 |
|
| 518 |
gr.HTML("<hr>")
|
| 519 |
gr.Markdown("## 3. Generate your dataset")
|
|
|
|
| 459 |
gr.HTML("<hr>")
|
| 460 |
gr.Markdown("## 2. Configure your dataset")
|
| 461 |
with gr.Row(equal_height=True):
|
| 462 |
+
with gr.Column(scale=2):
|
| 463 |
+
system_prompt = gr.Textbox(
|
| 464 |
+
label="System prompt",
|
| 465 |
+
placeholder="You are a helpful assistant.",
|
| 466 |
+
visible=True,
|
| 467 |
+
)
|
| 468 |
+
labels = gr.Dropdown(
|
| 469 |
+
choices=[],
|
| 470 |
+
allow_custom_value=True,
|
| 471 |
+
interactive=True,
|
| 472 |
+
label="Labels",
|
| 473 |
+
multiselect=True,
|
| 474 |
+
info="Add the labels to classify the text.",
|
| 475 |
+
)
|
| 476 |
+
multi_label = gr.Checkbox(
|
| 477 |
+
label="Multi-label",
|
| 478 |
+
value=False,
|
| 479 |
+
interactive=True,
|
| 480 |
+
info="If checked, the text will be classified into multiple labels.",
|
| 481 |
+
)
|
| 482 |
+
clarity = gr.Dropdown(
|
| 483 |
+
choices=[
|
| 484 |
+
("Clear", "clear"),
|
| 485 |
+
(
|
| 486 |
+
"Understandable",
|
| 487 |
+
"understandable with some effort",
|
| 488 |
+
),
|
| 489 |
+
("Ambiguous", "ambiguous"),
|
| 490 |
+
("Mixed", "mixed"),
|
| 491 |
+
],
|
| 492 |
+
value="mixed",
|
| 493 |
+
label="Clarity",
|
| 494 |
+
info="Set how easily the correct label or labels can be identified.",
|
| 495 |
+
interactive=True,
|
| 496 |
+
)
|
| 497 |
+
difficulty = gr.Dropdown(
|
| 498 |
+
choices=[
|
| 499 |
+
("High School", "high school"),
|
| 500 |
+
("College", "college"),
|
| 501 |
+
("PhD", "PhD"),
|
| 502 |
+
("Mixed", "mixed"),
|
| 503 |
+
],
|
| 504 |
+
value="high school",
|
| 505 |
+
label="Difficulty",
|
| 506 |
+
info="Select the comprehension level for the text. Ensure it matches the task context.",
|
| 507 |
+
interactive=True,
|
| 508 |
+
)
|
| 509 |
+
with gr.Row():
|
| 510 |
+
clear_btn_full = gr.Button("Clear", variant="secondary")
|
| 511 |
+
btn_apply_to_sample_dataset = gr.Button(
|
| 512 |
+
"Save", variant="primary"
|
| 513 |
)
|
| 514 |
+
with gr.Column(scale=3):
|
| 515 |
+
dataframe = _get_dataframe()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 516 |
|
| 517 |
gr.HTML("<hr>")
|
| 518 |
gr.Markdown("## 3. Generate your dataset")
|