Blog_Generator / app.py
AjithBharadwaj's picture
Update app.py
ae08c02 verified
raw
history blame
984 Bytes
import streamlit as st
def generate_blog_title(name, audience, word_count):
title = f"**Title:** {name} - A {audience} Guide to {word_count} Words"
return title
def main():
st.title("πŸ”₯ Professional Blog Generator πŸ”₯")
st.markdown(
"""
<style>
body {
background-color: #121212;;
color: white;
}
</style>
""",
unsafe_allow_html=True
)
st.sidebar.header("Input Parameters")
role = st.sidebar.text_input("Who is this intednded for ?", "Ex - Data Scientist")
topic = st.sidebar.text_input("On what Topic should the blog be on ?", "Ex - Machine Learning")
word_count = st.sidebar.slider("Number of Words", min_value=50, max_value=1000, value=200, step=50)
if st.sidebar.button("Generate Blog"):
blog_content = generate_blog(name, role, topic, word_count)
st.markdown(blog_content, unsafe_allow_html=True)
if __name__ == "__main__":
main()