Leyo commited on
Commit
56a05b6
β€’
1 Parent(s): 729af7e

Update app_dialogue.py

Browse files
Files changed (1) hide show
  1. app_dialogue.py +6 -5
app_dialogue.py CHANGED
@@ -297,7 +297,8 @@ chatbot = gr.Chatbot(
297
 
298
  dope_callback = gr.CSVLogger()
299
  problematic_callback = gr.CSVLogger()
300
- hf_writer = gr.HuggingFaceDatasetSaver(HF_WRITE_TOKEN, "HuggingFaceM4/dope-dataset")
 
301
 
302
  # Using Flagging for saving dope and problematic examples
303
  # Dope examples flagging
@@ -385,7 +386,7 @@ with gr.Blocks(
385
  dope_bttn = gr.Button("DopeπŸ”₯")
386
  with gr.Column(scale=1, min_width=50):
387
  problematic_bttn = gr.Button("Problematic😬")
388
- hf_writer.setup(
389
  [
390
  model_selector,
391
  chatbot,
@@ -398,7 +399,7 @@ with gr.Blocks(
398
  "gradio_dope_data_points",
399
  )
400
  dope_bttn.click(
401
- lambda *args: hf_writer.flag(args),
402
  [
403
  model_selector,
404
  chatbot,
@@ -412,7 +413,7 @@ with gr.Blocks(
412
  preprocess=False,
413
  )
414
  # Problematic examples flagging
415
- problematic_callback.setup(
416
  [
417
  model_selector,
418
  chatbot,
@@ -425,7 +426,7 @@ with gr.Blocks(
425
  "gradio_problematic_data_points",
426
  )
427
  problematic_bttn.click(
428
- lambda *args: problematic_callback.flag(args),
429
  [
430
  model_selector,
431
  chatbot,
 
297
 
298
  dope_callback = gr.CSVLogger()
299
  problematic_callback = gr.CSVLogger()
300
+ dope_dataset_writer = gr.HuggingFaceDatasetSaver(HF_WRITE_TOKEN, "HuggingFaceM4/dope-dataset")
301
+ problematic_dataset_writer = gr.HuggingFaceDatasetSaver(HF_WRITE_TOKEN, "HuggingFaceM4/problematic-dataset")
302
 
303
  # Using Flagging for saving dope and problematic examples
304
  # Dope examples flagging
 
386
  dope_bttn = gr.Button("DopeπŸ”₯")
387
  with gr.Column(scale=1, min_width=50):
388
  problematic_bttn = gr.Button("Problematic😬")
389
+ dope_dataset_writer.setup(
390
  [
391
  model_selector,
392
  chatbot,
 
399
  "gradio_dope_data_points",
400
  )
401
  dope_bttn.click(
402
+ lambda *args: dope_dataset_writer.flag(args),
403
  [
404
  model_selector,
405
  chatbot,
 
413
  preprocess=False,
414
  )
415
  # Problematic examples flagging
416
+ problematic_dataset_writer.setup(
417
  [
418
  model_selector,
419
  chatbot,
 
426
  "gradio_problematic_data_points",
427
  )
428
  problematic_bttn.click(
429
+ lambda *args: problematic_dataset_writer.flag(args),
430
  [
431
  model_selector,
432
  chatbot,