Update app.py
Browse files
app.py
CHANGED
@@ -646,6 +646,20 @@ def get_popular_datasets():
|
|
646 |
"ag_news"
|
647 |
]
|
648 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
649 |
css = """
|
650 |
body, #root {
|
651 |
margin: 0;
|
@@ -862,7 +876,7 @@ with demo:
|
|
862 |
with gr.Tab("Dataset Configuration"):
|
863 |
with gr.Row():
|
864 |
vodalus_system_message = gr.TextArea(label="System Message for JSONL Dataset", lines=10)
|
865 |
-
prompt_1 = gr.TextArea(label="Dataset
|
866 |
|
867 |
gr.Markdown("### Topics")
|
868 |
with gr.Row():
|
@@ -939,8 +953,9 @@ with demo:
|
|
939 |
frequency_penalty = gr.Slider(minimum=0, maximum=2, value=0.0, step=0.01, label="Frequency Penalty")
|
940 |
presence_penalty = gr.Slider(minimum=0, maximum=2, value=0.0, step=0.01, label="Presence Penalty")
|
941 |
|
942 |
-
|
943 |
-
|
|
|
944 |
|
945 |
add_topic.click(
|
946 |
lambda x: x + [["New Topic"]],
|
@@ -1115,17 +1130,7 @@ with demo:
|
|
1115 |
)
|
1116 |
|
1117 |
demo.load(
|
1118 |
-
|
1119 |
-
config := load_dataset_config(),
|
1120 |
-
gr.update(value=config["vodalus_system_message"]),
|
1121 |
-
gr.update(value=config["prompt_1"]),
|
1122 |
-
gr.update(value=config["topics"]),
|
1123 |
-
gr.update(value=config["max_tokens"]),
|
1124 |
-
gr.update(value=config["temperature"]),
|
1125 |
-
gr.update(value=config["top_p"]),
|
1126 |
-
gr.update(value=config["frequency_penalty"]),
|
1127 |
-
gr.update(value=config["presence_penalty"])
|
1128 |
-
)[1:],
|
1129 |
outputs=[
|
1130 |
vodalus_system_message,
|
1131 |
prompt_1,
|
|
|
646 |
"ag_news"
|
647 |
]
|
648 |
|
649 |
+
def load_dataset_config_for_ui():
|
650 |
+
config = load_dataset_config()
|
651 |
+
return (
|
652 |
+
config["vodalus_system_message"],
|
653 |
+
config["prompt_1"],
|
654 |
+
config["topics"],
|
655 |
+
config["max_tokens"],
|
656 |
+
config["temperature"],
|
657 |
+
config["top_p"],
|
658 |
+
config["frequency_penalty"],
|
659 |
+
config["presence_penalty"]
|
660 |
+
)
|
661 |
+
|
662 |
+
|
663 |
css = """
|
664 |
body, #root {
|
665 |
margin: 0;
|
|
|
876 |
with gr.Tab("Dataset Configuration"):
|
877 |
with gr.Row():
|
878 |
vodalus_system_message = gr.TextArea(label="System Message for JSONL Dataset", lines=10)
|
879 |
+
prompt_1 = gr.TextArea(label="Dataset Generation Prompt", lines=10)
|
880 |
|
881 |
gr.Markdown("### Topics")
|
882 |
with gr.Row():
|
|
|
953 |
frequency_penalty = gr.Slider(minimum=0, maximum=2, value=0.0, step=0.01, label="Frequency Penalty")
|
954 |
presence_penalty = gr.Slider(minimum=0, maximum=2, value=0.0, step=0.01, label="Presence Penalty")
|
955 |
|
956 |
+
with gr.Row():
|
957 |
+
save_dataset_config_btn = gr.Button("Save Dataset Configuration", variant="primary")
|
958 |
+
dataset_config_status = gr.Textbox(label="Status")
|
959 |
|
960 |
add_topic.click(
|
961 |
lambda x: x + [["New Topic"]],
|
|
|
1130 |
)
|
1131 |
|
1132 |
demo.load(
|
1133 |
+
load_dataset_config_for_ui,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1134 |
outputs=[
|
1135 |
vodalus_system_message,
|
1136 |
prompt_1,
|