Leyo commited on
Commit
e0775db
Β·
1 Parent(s): df502f9
Files changed (1) hide show
  1. app_dialogue.py +5 -7
app_dialogue.py CHANGED
@@ -268,13 +268,11 @@ def flag_chat(
268
  prev_ex_is_image = True
269
  else:
270
  if prev_ex_is_image:
271
- conversations.append([f"User:<image>{ex[0]}", f"\nAssistant:{ex[1]}"])
272
  else:
273
- conversations.append([f"User:{ex[0]}", f"\nAssistant:{ex[1]}"])
274
  prev_ex_is_image = False
275
 
276
- print(f"conversations: {conversations}\n dtype:{type(conversations)}")
277
- print(f"chat_history: {chat_history}\n dtype: {type(chat_history)}")
278
  dope_dataset_writer.flag(
279
  flag_data=[
280
  model_selector,
@@ -362,7 +360,7 @@ problematic_dataset_writer = gr.HuggingFaceDatasetSaver(
362
  # The second syntax allows inputting an arbitrary number of images.""")
363
 
364
  image_fake = gr.Image(visible=False)
365
-
366
  with gr.Blocks(
367
  fill_height=True,
368
  css=""".gradio-container .avatar-container {height: 40px width: 40px !important;}""",
@@ -441,7 +439,7 @@ with gr.Blocks(
441
  [
442
  model_selector,
443
  image_fake,
444
- chatbot,
445
  decoding_strategy,
446
  temperature,
447
  max_new_tokens,
@@ -469,7 +467,7 @@ with gr.Blocks(
469
  [
470
  model_selector,
471
  image_fake,
472
- chatbot,
473
  decoding_strategy,
474
  temperature,
475
  max_new_tokens,
 
268
  prev_ex_is_image = True
269
  else:
270
  if prev_ex_is_image:
271
+ conversations.append([f"User:<image>{ex[0]}", f"Assistant:{ex[1]}"])
272
  else:
273
+ conversations.append([f"User:{ex[0]}", f"Assistant:{ex[1]}"])
274
  prev_ex_is_image = False
275
 
 
 
276
  dope_dataset_writer.flag(
277
  flag_data=[
278
  model_selector,
 
360
  # The second syntax allows inputting an arbitrary number of images.""")
361
 
362
  image_fake = gr.Image(visible=False)
363
+ text_fake = gr.Textbox(visible=False)
364
  with gr.Blocks(
365
  fill_height=True,
366
  css=""".gradio-container .avatar-container {height: 40px width: 40px !important;}""",
 
439
  [
440
  model_selector,
441
  image_fake,
442
+ text_fake,
443
  decoding_strategy,
444
  temperature,
445
  max_new_tokens,
 
467
  [
468
  model_selector,
469
  image_fake,
470
+ text_fake,
471
  decoding_strategy,
472
  temperature,
473
  max_new_tokens,