Spaces:
Running on Zero

Ruurd commited on
Commit
150f6e1
·
verified ·
1 Parent(s): a86f3af

Change red highlighting for debugging

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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(previous_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:
 
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: