Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,9 @@ def generate(tokenizer, model, text, features):
|
|
| 15 |
)
|
| 16 |
for i, sample_output in enumerate(sample_outputs):
|
| 17 |
decoded = tokenizer.decode(sample_output, skip_special_tokens=False)
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
st.markdown('**' + author.strip() + '**: ' + text.replace('<|endoftext|>', '').replace('<|pad|>', '').strip())
|
| 20 |
|
| 21 |
|
|
|
|
| 15 |
)
|
| 16 |
for i, sample_output in enumerate(sample_outputs):
|
| 17 |
decoded = tokenizer.decode(sample_output, skip_special_tokens=False)
|
| 18 |
+
if '<|authornameend|>' not in decoded:
|
| 19 |
+
continue
|
| 20 |
+
author, text = decoded.split('<|authornamebegin|>')[1].split('<|authornameend|>')
|
| 21 |
st.markdown('**' + author.strip() + '**: ' + text.replace('<|endoftext|>', '').replace('<|pad|>', '').strip())
|
| 22 |
|
| 23 |
|