Spaces:
Running
on
Zero
Running
on
Zero
Add newlines to output
Browse files
app.py
CHANGED
@@ -173,7 +173,7 @@ def diffusion_chat(question, eot_weight, max_it, sharpness, noise_clipping, use_
|
|
173 |
highlighted = [tokenizer.convert_tokens_to_string([tok]) for tok in filtered_tokens]
|
174 |
|
175 |
prev_decoded_tokens = decoded_tokens
|
176 |
-
yield f"<b>Iteration {i+1}/{max_it} (running):</b><br>" + "".join(highlighted)
|
177 |
|
178 |
last_tokens.append(generated_tokens)
|
179 |
if len(last_tokens) > 3:
|
@@ -194,7 +194,7 @@ def diffusion_chat(question, eot_weight, max_it, sharpness, noise_clipping, use_
|
|
194 |
final_tokens = [tok for tok in final_tokens if tokenizer.convert_tokens_to_ids(tok) != eot_token_id]
|
195 |
final_output = tokenizer.convert_tokens_to_string(final_tokens)
|
196 |
print(final_output)
|
197 |
-
yield f"<b>Final Output (after {i+1} iterations):</b><br>" + final_output
|
198 |
|
199 |
# --- Gradio Interface ---
|
200 |
|
|
|
173 |
highlighted = [tokenizer.convert_tokens_to_string([tok]) for tok in filtered_tokens]
|
174 |
|
175 |
prev_decoded_tokens = decoded_tokens
|
176 |
+
yield f"<b>Iteration {i+1}/{max_it} (running):</b><br>" + "".join(highlighted).replace('\n', '<br>')
|
177 |
|
178 |
last_tokens.append(generated_tokens)
|
179 |
if len(last_tokens) > 3:
|
|
|
194 |
final_tokens = [tok for tok in final_tokens if tokenizer.convert_tokens_to_ids(tok) != eot_token_id]
|
195 |
final_output = tokenizer.convert_tokens_to_string(final_tokens)
|
196 |
print(final_output)
|
197 |
+
yield f"<b>Final Output (after {i+1} iterations):</b><br>" + final_output.replace('\n', '<br>')
|
198 |
|
199 |
# --- Gradio Interface ---
|
200 |
|