Spaces:
Runtime error
Runtime error
Make it so feedback can only be given after example
Browse files
app.py
CHANGED
|
@@ -96,7 +96,8 @@ def greet(input_text, length, function_words, grade_level, sarcasm, formality, v
|
|
| 96 |
|
| 97 |
# Save the obfuscation result
|
| 98 |
save_data(latest_obfuscation)
|
| 99 |
-
|
|
|
|
| 100 |
|
| 101 |
def reset_sliders():
|
| 102 |
return [0.5] * 10
|
|
@@ -198,17 +199,18 @@ with demo:
|
|
| 198 |
gr.Markdown("# 3) Obfuscated Output")
|
| 199 |
|
| 200 |
output = gr.Textbox(label="Output", lines=3)
|
| 201 |
-
obfuscate_button.click(fn=greet, inputs=[input_text] + sliders, outputs=output)
|
| 202 |
|
| 203 |
gr.Markdown("## Feedback [Optional]")
|
| 204 |
|
| 205 |
# Add thumbs up / thumbs down
|
| 206 |
gr.Markdown("### Is the response good or bad?")
|
| 207 |
-
feedback_rating = gr.Radio(choices=["No Feedback Selected", "Good π", "Bad π"], value="No Feedback Selected", interactive=
|
| 208 |
|
| 209 |
# Add feedback box
|
| 210 |
gr.Markdown("### Provide any feedback on the obfuscation")
|
| 211 |
-
feedback_text = gr.Textbox(label="Feedback", lines=3)
|
|
|
|
|
|
|
| 212 |
|
| 213 |
save_feedback_button = gr.Button("Save Feedback", interactive=False)
|
| 214 |
feedback_warning_message = gr.Markdown(
|
|
|
|
| 96 |
|
| 97 |
# Save the obfuscation result
|
| 98 |
save_data(latest_obfuscation)
|
| 99 |
+
|
| 100 |
+
return response, gr.update(interactive=True), gr.update(interactive=True)
|
| 101 |
|
| 102 |
def reset_sliders():
|
| 103 |
return [0.5] * 10
|
|
|
|
| 199 |
gr.Markdown("# 3) Obfuscated Output")
|
| 200 |
|
| 201 |
output = gr.Textbox(label="Output", lines=3)
|
|
|
|
| 202 |
|
| 203 |
gr.Markdown("## Feedback [Optional]")
|
| 204 |
|
| 205 |
# Add thumbs up / thumbs down
|
| 206 |
gr.Markdown("### Is the response good or bad?")
|
| 207 |
+
feedback_rating = gr.Radio(choices=["No Feedback Selected", "Good π", "Bad π"], value="No Feedback Selected", interactive=False, label="Rate the Response")
|
| 208 |
|
| 209 |
# Add feedback box
|
| 210 |
gr.Markdown("### Provide any feedback on the obfuscation")
|
| 211 |
+
feedback_text = gr.Textbox(label="Feedback", lines=3, interactive=False)
|
| 212 |
+
|
| 213 |
+
obfuscate_button.click(fn=greet, inputs=[input_text] + sliders, outputs=[output, feedback_rating, feedback_text])
|
| 214 |
|
| 215 |
save_feedback_button = gr.Button("Save Feedback", interactive=False)
|
| 216 |
feedback_warning_message = gr.Markdown(
|