krippto's picture
Update app.py
865fa03 verified
raw
history blame
1.46 kB
import streamlit as st
from utils import generate_script
st.markdown("""
<style>
div.stButton > button:first-child {
background-color: #0099ff;
color: #ffffff
}
div.stButton > button:hover {
background-color: #00ff00;
color: #FFFFFF;
}
</style>""",unsafe_allow_html=True)
if "API_Key" not in st.session_state:
st.session_state['API_Key']=''
st.title('❀️Youtube Script Writing Tool')
st.sidebar.title('πŸ˜ŽπŸ—οΈ')
st.session_state['API_Key']=st.sidebar.text_input("What's your API key?",type='password')
st.sidebar.image('./Youtube.png',width=300,use_column_width=True)
prompt= st.text_input("Please provide the topic of the video",key="prompt")
video_length = st.text_input("Expected Video Length πŸ•› (in minutes)",key = 'video_length')
creativity = st.slider('Creativity ✨ - (0 LOW || 1 HIGH)',0.0,1.0,0.2,step=0.1)
submit = st.button('Generate Script for me')
if submit:
if st.session_state["API_Key"]:
search_result,title,script = generate_script(prompt,video_length,creativity,st.session_state['API_Key'])
st.success("Hope you like this script ❀️")
st.subheader("Title:πŸ”₯")
st.write(title)
st.subheader("Your Video Script:πŸ“")
st.write(script)
st.subheader('Check Out - DuckDuckGo Search:πŸ”')
with st.expander("Show me πŸ‘€"):
st.info(search_result)
else:
st.error('Oooopsssss!!! Please provide API key......')