Spaces:
Running
Running
Select input dataframe also.
Browse files
app/gradio_sample_generator.py
CHANGED
@@ -179,8 +179,8 @@ with gr.Blocks(title="Task Description Generator") as demo:
|
|
179 |
)
|
180 |
with gr.Group():
|
181 |
with gr.Row():
|
182 |
-
|
183 |
-
|
184 |
append_example_button = gr.Button("Append to Input Examples", variant="secondary")
|
185 |
with gr.Row():
|
186 |
submit_button = gr.Button("Generate", variant="primary")
|
@@ -268,8 +268,8 @@ with gr.Blocks(title="Task Description Generator") as demo:
|
|
268 |
example_briefs_output,
|
269 |
examples_from_briefs_output,
|
270 |
examples_output,
|
271 |
-
|
272 |
-
|
273 |
],
|
274 |
value="Clear All"
|
275 |
)
|
@@ -353,22 +353,28 @@ with gr.Blocks(title="Task Description Generator") as demo:
|
|
353 |
outputs=[examples_from_briefs_output],
|
354 |
)
|
355 |
|
|
|
|
|
|
|
|
|
|
|
|
|
356 |
examples_directly_output.select(
|
357 |
fn=format_selected_example,
|
358 |
inputs=[examples_directly_output],
|
359 |
-
outputs=[
|
360 |
)
|
361 |
|
362 |
examples_from_briefs_output.select(
|
363 |
fn=format_selected_example,
|
364 |
inputs=[examples_from_briefs_output],
|
365 |
-
outputs=[
|
366 |
)
|
367 |
|
368 |
examples_output.select(
|
369 |
fn=format_selected_example,
|
370 |
inputs=[examples_output],
|
371 |
-
outputs=[
|
372 |
)
|
373 |
|
374 |
gr.Markdown("### Manual Flagging", visible=False)
|
@@ -392,7 +398,7 @@ with gr.Blocks(title="Task Description Generator") as demo:
|
|
392 |
|
393 |
append_example_button.click(
|
394 |
fn=append_example_to_input,
|
395 |
-
inputs=[
|
396 |
outputs=[input_df],
|
397 |
)
|
398 |
|
|
|
179 |
)
|
180 |
with gr.Group():
|
181 |
with gr.Row():
|
182 |
+
selected_example_input = gr.Textbox(label="Selected Example Input", lines=2, show_copy_button=True)
|
183 |
+
selected_example_output = gr.Textbox(label="Selected Example Output", lines=2, show_copy_button=True)
|
184 |
append_example_button = gr.Button("Append to Input Examples", variant="secondary")
|
185 |
with gr.Row():
|
186 |
submit_button = gr.Button("Generate", variant="primary")
|
|
|
268 |
example_briefs_output,
|
269 |
examples_from_briefs_output,
|
270 |
examples_output,
|
271 |
+
selected_example_input,
|
272 |
+
selected_example_output,
|
273 |
],
|
274 |
value="Clear All"
|
275 |
)
|
|
|
353 |
outputs=[examples_from_briefs_output],
|
354 |
)
|
355 |
|
356 |
+
input_df.select(
|
357 |
+
fn=format_selected_example,
|
358 |
+
inputs=[input_df],
|
359 |
+
outputs=[selected_example_input, selected_example_output],
|
360 |
+
)
|
361 |
+
|
362 |
examples_directly_output.select(
|
363 |
fn=format_selected_example,
|
364 |
inputs=[examples_directly_output],
|
365 |
+
outputs=[selected_example_input, selected_example_output],
|
366 |
)
|
367 |
|
368 |
examples_from_briefs_output.select(
|
369 |
fn=format_selected_example,
|
370 |
inputs=[examples_from_briefs_output],
|
371 |
+
outputs=[selected_example_input, selected_example_output],
|
372 |
)
|
373 |
|
374 |
examples_output.select(
|
375 |
fn=format_selected_example,
|
376 |
inputs=[examples_output],
|
377 |
+
outputs=[selected_example_input, selected_example_output],
|
378 |
)
|
379 |
|
380 |
gr.Markdown("### Manual Flagging", visible=False)
|
|
|
398 |
|
399 |
append_example_button.click(
|
400 |
fn=append_example_to_input,
|
401 |
+
inputs=[selected_example_input, selected_example_output, input_df],
|
402 |
outputs=[input_df],
|
403 |
)
|
404 |
|