Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,9 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from transformers import pipeline
|
| 3 |
-
|
| 4 |
-
# Set a seed for reproducibility
|
| 5 |
-
set_seed(42)
|
| 6 |
|
| 7 |
# Load the text generation pipeline with gpt2-large
|
| 8 |
try:
|
| 9 |
generator = pipeline('text-generation', model='gpt2-large')
|
| 10 |
-
st.write("Model loaded successfully.")
|
| 11 |
-
except Exception as e:
|
| 12 |
-
st.write(f"Error loading model: {e}")
|
| 13 |
|
| 14 |
def generate_blog_post(topic):
|
| 15 |
try:
|
|
@@ -21,7 +15,7 @@ def generate_blog_post(topic):
|
|
| 21 |
|
| 22 |
# Streamlit app
|
| 23 |
st.title("Blog Post Generator")
|
| 24 |
-
topic = st.text_input("Enter the topic for the blog post:"
|
| 25 |
|
| 26 |
if st.button("Generate"):
|
| 27 |
with st.spinner('Generating blog post...'):
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
# Load the text generation pipeline with gpt2-large
|
| 5 |
try:
|
| 6 |
generator = pipeline('text-generation', model='gpt2-large')
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def generate_blog_post(topic):
|
| 9 |
try:
|
|
|
|
| 15 |
|
| 16 |
# Streamlit app
|
| 17 |
st.title("Blog Post Generator")
|
| 18 |
+
topic = st.text_input("Enter the topic for the blog post:")
|
| 19 |
|
| 20 |
if st.button("Generate"):
|
| 21 |
with st.spinner('Generating blog post...'):
|