Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from StreamlitModel import TextGeneration | |
| def main(): | |
| # Set page configuration | |
| st.set_page_config( | |
| page_title="Lyrics Generation App", | |
| page_icon="🎤", | |
| layout="wide", | |
| initial_sidebar_state="auto", | |
| ) | |
| # Custom CSS for changing font and styling | |
| st.markdown( | |
| """ | |
| <style> | |
| body { | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| background-color: #f7f7f7; | |
| color: #333333; | |
| } | |
| .stTextInput textarea { | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| } | |
| .stButton button { | |
| background-color: #3498db; | |
| color: #ffffff; | |
| font-weight: bold; | |
| } | |
| .stButton button:hover { | |
| background-color: #2980b9; | |
| } | |
| .stWarning { | |
| background-color: #e74c3c; | |
| color: #ffffff; | |
| } | |
| </style> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| # App content | |
| st.title("Lyrics Generation") | |
| st.text("Enter a word or phrase here to generate lyrics for your new hit song!") | |
| st.text("This is a work in progress, and I will update it as needed") | |
| st.text("Please allow up to 10 minutes for the text to generate. The CPU is slow") | |
| st.text("You can refer to the GitHub repository in the link below for more info or if you want to run it locally (way faster)") | |
| st.write("[Repository](https://github.com/Selbl/LyricGeneration)") | |
| # User input for prompt | |
| prompt = st.text_area("Enter the first word or phrase of your new song here:") | |
| # Button to generate text | |
| if st.button("Generate Song"): | |
| if prompt: | |
| # Call your function to generate text | |
| generated_text = TextGeneration(prompt) | |
| st.subheader("Generated Song:") | |
| st.write(generated_text) | |
| else: | |
| st.warning("Please enter a word or phrase.") | |
| if __name__ == "__main__": | |
| main() | |