Spaces:
Running
on
Zero
Running
on
Zero
Update app_dialogue.py
Browse files- app_dialogue.py +29 -12
app_dialogue.py
CHANGED
|
@@ -255,6 +255,7 @@ def flag_chat(
|
|
| 255 |
max_new_tokens,
|
| 256 |
repetition_penalty,
|
| 257 |
top_p,
|
|
|
|
| 258 |
):
|
| 259 |
images = []
|
| 260 |
text_flag = []
|
|
@@ -270,18 +271,32 @@ def flag_chat(
|
|
| 270 |
text_flag.append([f"User:{ex[0]}", f"Assistant:{ex[1]}"])
|
| 271 |
prev_ex_is_image = False
|
| 272 |
image_flag = images[0]
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
|
| 286 |
|
| 287 |
# Hyper-parameters for generation
|
|
@@ -470,6 +485,7 @@ with gr.Blocks(
|
|
| 470 |
max_new_tokens,
|
| 471 |
repetition_penalty,
|
| 472 |
top_p,
|
|
|
|
| 473 |
],
|
| 474 |
"gradio_problematic_data_points",
|
| 475 |
)
|
|
@@ -483,6 +499,7 @@ with gr.Blocks(
|
|
| 483 |
max_new_tokens,
|
| 484 |
repetition_penalty,
|
| 485 |
top_p,
|
|
|
|
| 486 |
],
|
| 487 |
outputs=None,
|
| 488 |
preprocess=False,
|
|
|
|
| 255 |
max_new_tokens,
|
| 256 |
repetition_penalty,
|
| 257 |
top_p,
|
| 258 |
+
dope,
|
| 259 |
):
|
| 260 |
images = []
|
| 261 |
text_flag = []
|
|
|
|
| 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
|
|
|
|
| 485 |
max_new_tokens,
|
| 486 |
repetition_penalty,
|
| 487 |
top_p,
|
| 488 |
+
True,
|
| 489 |
],
|
| 490 |
"gradio_problematic_data_points",
|
| 491 |
)
|
|
|
|
| 499 |
max_new_tokens,
|
| 500 |
repetition_penalty,
|
| 501 |
top_p,
|
| 502 |
+
False,
|
| 503 |
],
|
| 504 |
outputs=None,
|
| 505 |
preprocess=False,
|