Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ if st.button('Generate Text'):
|
|
| 19 |
input_text = input_text.strip()
|
| 20 |
input_text = "generate text:{}".format(input_text) # Add the generation prefix
|
| 21 |
input_ids = tokenizer.encode(input_text, return_tensors='pt', max_length=512, truncation=True)
|
| 22 |
-
outputs = model.generate(input_ids, max_length=
|
| 23 |
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 24 |
st.write('Generated Text:')
|
| 25 |
st.write(generated_text)
|
|
|
|
| 19 |
input_text = input_text.strip()
|
| 20 |
input_text = "generate text:{}".format(input_text) # Add the generation prefix
|
| 21 |
input_ids = tokenizer.encode(input_text, return_tensors='pt', max_length=512, truncation=True)
|
| 22 |
+
outputs = model.generate(input_ids, max_length=512) # Specify the maximum length of the generated text
|
| 23 |
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 24 |
st.write('Generated Text:')
|
| 25 |
st.write(generated_text)
|