Leyo commited on
Commit
0a45780
β€’
1 Parent(s): 6d0e1b4
Files changed (1) hide show
  1. app_dialogue.py +4 -3
app_dialogue.py CHANGED
@@ -60,6 +60,7 @@ SYSTEM_PROMPT = [
60
  ]
61
 
62
  API_TOKEN = os.getenv("HF_AUTH_TOKEN")
 
63
  # IDEFICS_LOGO = "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/IDEFICS_logo.png"
64
  BOT_AVATAR = "IDEFICS_logo.png"
65
 
@@ -296,7 +297,7 @@ chatbot = gr.Chatbot(
296
 
297
  dope_callback = gr.CSVLogger()
298
  problematic_callback = gr.CSVLogger()
299
-
300
 
301
  # Using Flagging for saving dope and problematic examples
302
  # Dope examples flagging
@@ -384,7 +385,7 @@ with gr.Blocks(
384
  dope_bttn = gr.Button("DopeπŸ”₯")
385
  with gr.Column(scale=1, min_width=50):
386
  problematic_bttn = gr.Button("Problematic😬")
387
- dope_callback.setup(
388
  [
389
  model_selector,
390
  chatbot,
@@ -397,7 +398,7 @@ with gr.Blocks(
397
  "gradio_dope_data_points",
398
  )
399
  dope_bttn.click(
400
- lambda *args: dope_callback.flag(args),
401
  [
402
  model_selector,
403
  chatbot,
 
60
  ]
61
 
62
  API_TOKEN = os.getenv("HF_AUTH_TOKEN")
63
+ HF_WRITE_TOKEN = os.getenv("HF_WRITE_TOKEN")
64
  # IDEFICS_LOGO = "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/IDEFICS_logo.png"
65
  BOT_AVATAR = "IDEFICS_logo.png"
66
 
 
297
 
298
  dope_callback = gr.CSVLogger()
299
  problematic_callback = gr.CSVLogger()
300
+ hf_writer = gr.HuggingFaceDatasetSaver(HF_WRITE_TOKEN, "image-classification-mistakes")
301
 
302
  # Using Flagging for saving dope and problematic examples
303
  # Dope examples flagging
 
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
  "gradio_dope_data_points",
399
  )
400
  dope_bttn.click(
401
+ lambda *args: hf_writer.flag(args),
402
  [
403
  model_selector,
404
  chatbot,