Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,10 +22,10 @@ if st.button("Generate Blog Post"):
|
|
22 |
inputs_encoded = tokenizer.encode(prompt, return_tensors="pt")
|
23 |
|
24 |
# Generate text
|
25 |
-
model_output = model.generate(inputs_encoded, max_new_tokens=
|
26 |
|
27 |
# Decode the output
|
28 |
-
output = tokenizer.decode(model_output
|
29 |
|
30 |
# Display the generated blog post
|
31 |
st.subheader("Generated Blog Post:")
|
|
|
22 |
inputs_encoded = tokenizer.encode(prompt, return_tensors="pt")
|
23 |
|
24 |
# Generate text
|
25 |
+
model_output = model.generate(inputs_encoded, max_new_tokens=200, do_sample=True, temperature=0.7)
|
26 |
|
27 |
# Decode the output
|
28 |
+
output = tokenizer.decode(model_output, skip_special_tokens=True)
|
29 |
|
30 |
# Display the generated blog post
|
31 |
st.subheader("Generated Blog Post:")
|