Spaces:
Running
on
Zero
Running
on
Zero
Change red highlighting for debugging
Browse files
app.py
CHANGED
|
@@ -269,12 +269,12 @@ def diffusion_chat(question, eot_weight, mask_weight, max_it, pause_length, shar
|
|
| 269 |
current_tokens = ori_input_tokens[:answer_start] + noised_answer[answer_start:]
|
| 270 |
|
| 271 |
# --- RED HIGHLIGHT ---
|
| 272 |
-
decoded_tokens = tokenizer.convert_ids_to_tokens(
|
| 273 |
highlighted = []
|
| 274 |
for j, tok in enumerate(decoded_tokens):
|
| 275 |
tok_id = tokenizer.convert_tokens_to_ids(tok)
|
| 276 |
-
if tok_id == eot_token_id:
|
| 277 |
-
|
| 278 |
token_str = tokenizer.convert_tokens_to_string([tok])
|
| 279 |
abs_idx = answer_start + j
|
| 280 |
if abs_idx in just_noised_indices:
|
|
|
|
| 269 |
current_tokens = ori_input_tokens[:answer_start] + noised_answer[answer_start:]
|
| 270 |
|
| 271 |
# --- RED HIGHLIGHT ---
|
| 272 |
+
decoded_tokens = tokenizer.convert_ids_to_tokens(current_tokens[answer_start:])
|
| 273 |
highlighted = []
|
| 274 |
for j, tok in enumerate(decoded_tokens):
|
| 275 |
tok_id = tokenizer.convert_tokens_to_ids(tok)
|
| 276 |
+
# if tok_id == eot_token_id:
|
| 277 |
+
# continue
|
| 278 |
token_str = tokenizer.convert_tokens_to_string([tok])
|
| 279 |
abs_idx = answer_start + j
|
| 280 |
if abs_idx in just_noised_indices:
|