Leyo commited on
Commit
914f129
1 Parent(s): 47891ea

update changes

Browse files
Files changed (21) hide show
  1. app_dialogue.py +47 -43
  2. gradio_dope_data_points/dope-dataset-newtest/.lock +0 -0
  3. gradio_dope_data_points/dope-dataset-newtest/Idefics2/b96df475a33c0ab4ab12/Screenshot 2024-03-07 at 17.09.58.png +3 -0
  4. gradio_dope_data_points/dope-dataset-newtest/data.csv +2 -0
  5. gradio_dope_data_points/dope-dataset-newtest/dataset_info.json +1 -0
  6. gradio_dope_data_points/dope-dataset-newtest/dataset_info.json.lock +0 -0
  7. gradio_dope_data_points/dope-dataset-newtest/f6a3e41f11e610f7f4ca/Screenshot 2024-03-07 at 17.09.58.png +3 -0
  8. gradio_dope_data_points/dope-dataset/.lock +0 -0
  9. gradio_dope_data_points/dope-dataset/7842a960dbd3fcdb5dd2/Screenshot 2024-03-07 at 16.56.07.png +3 -0
  10. gradio_dope_data_points/dope-dataset/Idefics2/cb570cd31053bb98441c/Screenshot 2024-03-07 at 16.56.07.png +3 -0
  11. gradio_dope_data_points/dope-dataset/data.csv +2 -0
  12. gradio_dope_data_points/dope-dataset/dataset_info.json +1 -0
  13. gradio_dope_data_points/dope-dataset/dataset_info.json.lock +0 -0
  14. gradio_problematic_data_points/problematic-dataset/.lock +0 -0
  15. gradio_problematic_data_points/problematic-dataset/15b73ed2b9bf09f8ef3a/Screenshot 2024-03-07 at 16.56.07.png +3 -0
  16. gradio_problematic_data_points/problematic-dataset/6a022778a3fdcd4eee97/Screenshot 2024-03-07 at 17.09.58.png +3 -0
  17. gradio_problematic_data_points/problematic-dataset/Idefics2/448fff2cf09ea322e507/Screenshot 2024-03-07 at 17.09.58.png +3 -0
  18. gradio_problematic_data_points/problematic-dataset/Idefics2/8a6e745fd3c0a1fd4ec4/Screenshot 2024-03-07 at 16.56.07.png +3 -0
  19. gradio_problematic_data_points/problematic-dataset/data.csv +3 -0
  20. gradio_problematic_data_points/problematic-dataset/dataset_info.json +1 -0
  21. gradio_problematic_data_points/problematic-dataset/dataset_info.json.lock +0 -0
app_dialogue.py CHANGED
@@ -247,7 +247,7 @@ def model_inference(
247
  print("-----")
248
 
249
 
250
- def flag_chat(
251
  model_selector,
252
  chat_history,
253
  decoding_strategy,
@@ -255,48 +255,55 @@ def flag_chat(
255
  max_new_tokens,
256
  repetition_penalty,
257
  top_p,
258
- dope,
259
  ):
260
  images = []
261
- text_flag = []
262
- prev_ex_is_image = False
263
  for ex in chat_history:
264
  if isinstance(ex[0], dict):
265
  images.append(ex[0]["file"])
266
  prev_ex_is_image = True
267
- else:
268
- if prev_ex_is_image:
269
- text_flag.append([f"User:<image>{ex[0]}", f"Assistant:{ex[1]}"])
270
- else:
271
- text_flag.append([f"User:{ex[0]}", f"Assistant:{ex[1]}"])
272
- prev_ex_is_image = False
273
  image_flag = images[0]
274
- if dope:
275
- dope_dataset_writer.flag(
276
- flag_data=[
277
- model_selector,
278
- image_flag,
279
- text_flag,
280
- decoding_strategy,
281
- temperature,
282
- max_new_tokens,
283
- repetition_penalty,
284
- top_p,
285
- ]
286
- )
287
- else:
288
- problematic_dataset_writer.flag(
289
- flag_data=[
290
- model_selector,
291
- image_flag,
292
- text_flag,
293
- decoding_strategy,
294
- temperature,
295
- max_new_tokens,
296
- repetition_penalty,
297
- top_p,
298
- ]
299
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
 
301
 
302
  # Hyper-parameters for generation
@@ -372,7 +379,6 @@ problematic_dataset_writer = gr.HuggingFaceDatasetSaver(
372
  # The second syntax allows inputting an arbitrary number of images.""")
373
 
374
  image_flag = gr.Image(visible=False)
375
- text_flag = gr.Textbox(visible=False)
376
  with gr.Blocks(
377
  fill_height=True,
378
  css=""".gradio-container .avatar-container {height: 40px width: 40px !important;}""",
@@ -451,7 +457,7 @@ with gr.Blocks(
451
  [
452
  model_selector,
453
  image_flag,
454
- text_flag,
455
  decoding_strategy,
456
  temperature,
457
  max_new_tokens,
@@ -461,7 +467,7 @@ with gr.Blocks(
461
  "gradio_dope_data_points",
462
  )
463
  dope_bttn.click(
464
- fn=flag_chat,
465
  inputs=[
466
  model_selector,
467
  chatbot,
@@ -470,7 +476,6 @@ with gr.Blocks(
470
  max_new_tokens,
471
  repetition_penalty,
472
  top_p,
473
- True,
474
  ],
475
  outputs=None,
476
  preprocess=False,
@@ -480,7 +485,7 @@ with gr.Blocks(
480
  [
481
  model_selector,
482
  image_flag,
483
- text_flag,
484
  decoding_strategy,
485
  temperature,
486
  max_new_tokens,
@@ -490,7 +495,7 @@ with gr.Blocks(
490
  "gradio_problematic_data_points",
491
  )
492
  problematic_bttn.click(
493
- fn=flag_chat,
494
  inputs=[
495
  model_selector,
496
  chatbot,
@@ -499,7 +504,6 @@ with gr.Blocks(
499
  max_new_tokens,
500
  repetition_penalty,
501
  top_p,
502
- False,
503
  ],
504
  outputs=None,
505
  preprocess=False,
 
247
  print("-----")
248
 
249
 
250
+ def flag_dope(
251
  model_selector,
252
  chat_history,
253
  decoding_strategy,
 
255
  max_new_tokens,
256
  repetition_penalty,
257
  top_p,
 
258
  ):
259
  images = []
 
 
260
  for ex in chat_history:
261
  if isinstance(ex[0], dict):
262
  images.append(ex[0]["file"])
263
  prev_ex_is_image = True
264
+
 
 
 
 
 
265
  image_flag = images[0]
266
+ dope_dataset_writer.flag(
267
+ flag_data=[
268
+ model_selector,
269
+ image_flag,
270
+ chat_history,
271
+ decoding_strategy,
272
+ temperature,
273
+ max_new_tokens,
274
+ repetition_penalty,
275
+ top_p,
276
+ ]
277
+ )
278
+
279
+
280
+ def flag_problematic(
281
+ model_selector,
282
+ chat_history,
283
+ decoding_strategy,
284
+ temperature,
285
+ max_new_tokens,
286
+ repetition_penalty,
287
+ top_p,
288
+ ):
289
+ images = []
290
+ for ex in chat_history:
291
+ if isinstance(ex[0], dict):
292
+ images.append(ex[0]["file"])
293
+
294
+ image_flag = images[0]
295
+ problematic_dataset_writer.flag(
296
+ flag_data=[
297
+ model_selector,
298
+ image_flag,
299
+ chat_history,
300
+ decoding_strategy,
301
+ temperature,
302
+ max_new_tokens,
303
+ repetition_penalty,
304
+ top_p,
305
+ ]
306
+ )
307
 
308
 
309
  # Hyper-parameters for generation
 
379
  # The second syntax allows inputting an arbitrary number of images.""")
380
 
381
  image_flag = gr.Image(visible=False)
 
382
  with gr.Blocks(
383
  fill_height=True,
384
  css=""".gradio-container .avatar-container {height: 40px width: 40px !important;}""",
 
457
  [
458
  model_selector,
459
  image_flag,
460
+ chatbot,
461
  decoding_strategy,
462
  temperature,
463
  max_new_tokens,
 
467
  "gradio_dope_data_points",
468
  )
469
  dope_bttn.click(
470
+ fn=flag_dope,
471
  inputs=[
472
  model_selector,
473
  chatbot,
 
476
  max_new_tokens,
477
  repetition_penalty,
478
  top_p,
 
479
  ],
480
  outputs=None,
481
  preprocess=False,
 
485
  [
486
  model_selector,
487
  image_flag,
488
+ chatbot,
489
  decoding_strategy,
490
  temperature,
491
  max_new_tokens,
 
495
  "gradio_problematic_data_points",
496
  )
497
  problematic_bttn.click(
498
+ fn=flag_problematic,
499
  inputs=[
500
  model_selector,
501
  chatbot,
 
504
  max_new_tokens,
505
  repetition_penalty,
506
  top_p,
 
507
  ],
508
  outputs=None,
509
  preprocess=False,
gradio_dope_data_points/dope-dataset-newtest/.lock ADDED
File without changes
gradio_dope_data_points/dope-dataset-newtest/Idefics2/b96df475a33c0ab4ab12/Screenshot 2024-03-07 at 17.09.58.png ADDED

Git LFS Details

  • SHA256: 3c1e5b9ff070b0269f0663dd99ce6019f90d31ffe7e367a6ab3ce318116220af
  • Pointer size: 130 Bytes
  • Size of remote file: 21.1 kB
gradio_dope_data_points/dope-dataset-newtest/data.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ Model,, file,Idefics2,Decoding strategy,Sampling temperature,Maximum number of new tokens to generate,Repetition penalty,Top P,flag,username
2
+ idefics2-8b-chatty,f6a3e41f11e610f7f4ca/Screenshot 2024-03-07 at 17.09.58.png,https://huggingface.co/datasets/HuggingFaceM4/dope-dataset-newtest/resolve/main/f6a3e41f11e610f7f4ca/Screenshot%202024-03-07%20at%2017.09.58.png,"[[{""file"": ""/home/user/app/gradio_dope_data_points/dope-dataset-newtest/Idefics2/b96df475a33c0ab4ab12/Screenshot 2024-03-07 at 17.09.58.png"", ""alt_text"": null}, null], [""describe the image"", ""The image features a cheerful yellow smiley face emoji, which is a popular graphic symbol used to express happiness or positive emotions. This particular smiley face is holding a blue watering can, indicating that it might be involved in gardening or plant care activities. The smiley face is also holding a green plant, suggesting that it's nurturing the plant by watering it. The background of the image is black, providing a stark contrast that makes the yellow smiley face stand out prominently. Overall, the image conveys a sense of joy and care for nature.""]]",Greedy,0.4,512,1.1,0.8,,
gradio_dope_data_points/dope-dataset-newtest/dataset_info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"flagged": {"features": {"Model": {"dtype": "string", "_type": "Value"}, "": {"dtype": "string", "_type": "Value"}, " file": {"_type": "Image"}, "Idefics2": {"dtype": "string", "_type": "Value"}, "Decoding strategy": {"dtype": "string", "_type": "Value"}, "Sampling temperature": {"dtype": "string", "_type": "Value"}, "Maximum number of new tokens to generate": {"dtype": "string", "_type": "Value"}, "Repetition penalty": {"dtype": "string", "_type": "Value"}, "Top P": {"dtype": "string", "_type": "Value"}, "flag": {"dtype": "string", "_type": "Value"}, "username": {"dtype": "string", "_type": "Value"}}}}
gradio_dope_data_points/dope-dataset-newtest/dataset_info.json.lock ADDED
File without changes
gradio_dope_data_points/dope-dataset-newtest/f6a3e41f11e610f7f4ca/Screenshot 2024-03-07 at 17.09.58.png ADDED

Git LFS Details

  • SHA256: 3c1e5b9ff070b0269f0663dd99ce6019f90d31ffe7e367a6ab3ce318116220af
  • Pointer size: 130 Bytes
  • Size of remote file: 21.1 kB
gradio_dope_data_points/dope-dataset/.lock ADDED
File without changes
gradio_dope_data_points/dope-dataset/7842a960dbd3fcdb5dd2/Screenshot 2024-03-07 at 16.56.07.png ADDED

Git LFS Details

  • SHA256: 97a800ca115baee2fa94bc8c49d78a06c3d9eba031854eece56e2d39f10668ab
  • Pointer size: 130 Bytes
  • Size of remote file: 66.4 kB
gradio_dope_data_points/dope-dataset/Idefics2/cb570cd31053bb98441c/Screenshot 2024-03-07 at 16.56.07.png ADDED

Git LFS Details

  • SHA256: 97a800ca115baee2fa94bc8c49d78a06c3d9eba031854eece56e2d39f10668ab
  • Pointer size: 130 Bytes
  • Size of remote file: 66.4 kB
gradio_dope_data_points/dope-dataset/data.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ Model,, file,Idefics2,Decoding strategy,Sampling temperature,Maximum number of new tokens to generate,Repetition penalty,Top P,flag,username
2
+ idefics2-8b-chatty,7842a960dbd3fcdb5dd2/Screenshot 2024-03-07 at 16.56.07.png,https://huggingface.co/datasets/HuggingFaceM4/dope-dataset/resolve/main/7842a960dbd3fcdb5dd2/Screenshot%202024-03-07%20at%2016.56.07.png,"[[{""file"": ""/home/user/app/gradio_dope_data_points/dope-dataset/Idefics2/cb570cd31053bb98441c/Screenshot 2024-03-07 at 16.56.07.png"", ""alt_text"": null}, null], [""describe the image"", ""The image features a yellow smiley face with black eyes and arms. The smiley face is holding a red laser pointer that is pointing towards a long string of numbers. The numbers are written in white and are arranged in a horizontal line. The background of the image is black. The smiley face appears to be aiming the laser at the numbers, as if trying to draw attention to them or highlight their significance. The overall scene suggests a playful yet focused approach to presenting data or information.""]]",Greedy,0.4,512,1.1,0.8,,
gradio_dope_data_points/dope-dataset/dataset_info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"flagged": {"features": {"Model": {"dtype": "string", "_type": "Value"}, "": {"dtype": "string", "_type": "Value"}, " file": {"_type": "Image"}, "Idefics2": {"dtype": "string", "_type": "Value"}, "Decoding strategy": {"dtype": "string", "_type": "Value"}, "Sampling temperature": {"dtype": "string", "_type": "Value"}, "Maximum number of new tokens to generate": {"dtype": "string", "_type": "Value"}, "Repetition penalty": {"dtype": "string", "_type": "Value"}, "Top P": {"dtype": "string", "_type": "Value"}, "flag": {"dtype": "string", "_type": "Value"}, "username": {"dtype": "string", "_type": "Value"}}}}
gradio_dope_data_points/dope-dataset/dataset_info.json.lock ADDED
File without changes
gradio_problematic_data_points/problematic-dataset/.lock ADDED
File without changes
gradio_problematic_data_points/problematic-dataset/15b73ed2b9bf09f8ef3a/Screenshot 2024-03-07 at 16.56.07.png ADDED

Git LFS Details

  • SHA256: 97a800ca115baee2fa94bc8c49d78a06c3d9eba031854eece56e2d39f10668ab
  • Pointer size: 130 Bytes
  • Size of remote file: 66.4 kB
gradio_problematic_data_points/problematic-dataset/6a022778a3fdcd4eee97/Screenshot 2024-03-07 at 17.09.58.png ADDED

Git LFS Details

  • SHA256: 3c1e5b9ff070b0269f0663dd99ce6019f90d31ffe7e367a6ab3ce318116220af
  • Pointer size: 130 Bytes
  • Size of remote file: 21.1 kB
gradio_problematic_data_points/problematic-dataset/Idefics2/448fff2cf09ea322e507/Screenshot 2024-03-07 at 17.09.58.png ADDED

Git LFS Details

  • SHA256: 3c1e5b9ff070b0269f0663dd99ce6019f90d31ffe7e367a6ab3ce318116220af
  • Pointer size: 130 Bytes
  • Size of remote file: 21.1 kB
gradio_problematic_data_points/problematic-dataset/Idefics2/8a6e745fd3c0a1fd4ec4/Screenshot 2024-03-07 at 16.56.07.png ADDED

Git LFS Details

  • SHA256: 97a800ca115baee2fa94bc8c49d78a06c3d9eba031854eece56e2d39f10668ab
  • Pointer size: 130 Bytes
  • Size of remote file: 66.4 kB
gradio_problematic_data_points/problematic-dataset/data.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ Model,, file,Idefics2,Decoding strategy,Sampling temperature,Maximum number of new tokens to generate,Repetition penalty,Top P,flag,username
2
+ idefics2-8b-chatty,6a022778a3fdcd4eee97/Screenshot 2024-03-07 at 17.09.58.png,https://huggingface.co/datasets/HuggingFaceM4/problematic-dataset/resolve/main/6a022778a3fdcd4eee97/Screenshot%202024-03-07%20at%2017.09.58.png,"[[{""file"": ""/home/user/app/gradio_problematic_data_points/problematic-dataset/Idefics2/448fff2cf09ea322e507/Screenshot 2024-03-07 at 17.09.58.png"", ""alt_text"": null}, null], [""describe the image"", ""The image features a cheerful yellow smiley face emoji, which is a popular graphic symbol used to express happiness or positive emotions. This particular smiley face is holding a blue watering can, indicating that it might be involved in gardening or plant care activities. The smiley face is also holding a green plant, suggesting that it's nurturing the plant by watering it. The background of the image is black, providing a stark contrast that makes the yellow smiley face stand out prominently. Overall, the image conveys a sense of joy and care for nature.""]]",Greedy,0.4,512,1.1,0.8,,
3
+ idefics2-8b-chatty,15b73ed2b9bf09f8ef3a/Screenshot 2024-03-07 at 16.56.07.png,https://huggingface.co/datasets/HuggingFaceM4/problematic-dataset/resolve/main/15b73ed2b9bf09f8ef3a/Screenshot%202024-03-07%20at%2016.56.07.png,"[[{""file"": ""/home/user/app/gradio_problematic_data_points/problematic-dataset/Idefics2/8a6e745fd3c0a1fd4ec4/Screenshot 2024-03-07 at 16.56.07.png"", ""alt_text"": null}, null], [""describe the image"", ""The image features a yellow smiley face with black eyes and arms. The smiley face is holding a red laser pointer that is pointing towards a long string of numbers. The numbers are written in white and are arranged in a horizontal line. The background of the image is black. The smiley face appears to be aiming the laser at the numbers, as if trying to draw attention to them or highlight their significance. The overall scene suggests a playful yet focused approach to presenting data or information.""]]",Greedy,0.4,512,1.1,0.8,,
gradio_problematic_data_points/problematic-dataset/dataset_info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"flagged": {"features": {"Model": {"dtype": "string", "_type": "Value"}, "": {"dtype": "string", "_type": "Value"}, " file": {"_type": "Image"}, "Idefics2": {"dtype": "string", "_type": "Value"}, "Decoding strategy": {"dtype": "string", "_type": "Value"}, "Sampling temperature": {"dtype": "string", "_type": "Value"}, "Maximum number of new tokens to generate": {"dtype": "string", "_type": "Value"}, "Repetition penalty": {"dtype": "string", "_type": "Value"}, "Top P": {"dtype": "string", "_type": "Value"}, "flag": {"dtype": "string", "_type": "Value"}, "username": {"dtype": "string", "_type": "Value"}}}}
gradio_problematic_data_points/problematic-dataset/dataset_info.json.lock ADDED
File without changes