Spaces:
Sleeping
Sleeping
Update utils.py
Browse filesprint space in markdown
utils.py
CHANGED
@@ -32,16 +32,16 @@ def get_res(model_name, input_sentence, single_print=True):
|
|
32 |
res = []
|
33 |
for x in w:
|
34 |
if x == '\n':
|
35 |
-
res.append(
|
36 |
else:
|
37 |
-
res.append(f'<span style="font-size:1.25em;background-color:{next(color_iterator)}">{x}</span>')
|
38 |
else:
|
39 |
res = []
|
40 |
for x in out:
|
41 |
if x == '\n':
|
42 |
-
res.append(
|
43 |
else:
|
44 |
-
res.append(f'<span style="font-size:1.25em;background-color:{next(color_iterator)}">{tokenizer.decode(x)}</span>')
|
45 |
|
46 |
res = ''.join(res)
|
47 |
if single_print:
|
|
|
32 |
res = []
|
33 |
for x in w:
|
34 |
if x == '\n':
|
35 |
+
res.append(' \n')
|
36 |
else:
|
37 |
+
res.append(f'<span style="font-size:1.25em;background-color:{next(color_iterator)}">{x.replace(" ", " ")}</span>')
|
38 |
else:
|
39 |
res = []
|
40 |
for x in out:
|
41 |
if x == '\n':
|
42 |
+
res.append(' \n')
|
43 |
else:
|
44 |
+
res.append(f'<span style="font-size:1.25em;background-color:{next(color_iterator)}">{tokenizer.decode(x).replace(" ", " ")}</span>')
|
45 |
|
46 |
res = ''.join(res)
|
47 |
if single_print:
|