hallisky commited on
Commit
70aff72
Β·
1 Parent(s): 3a381f9

Make it so feedback can only be given after example

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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
- return response
 
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=True, 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)
 
 
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(