Inspiration
I came up with the idea for LyricMuse while chatting with a friend who was writing lyrics for her song to post on YouTube. She hit a roadblock with a specific phrase but had a general idea of what she wanted to express. Seeing her struggle, I felt compelled to create something to lend a hand to help get over that roadblock and so, LyricMuse was born.
What it does
LyricMuse is a creative tool for musicians facing lyric-writing challenges. By generating AI-crafted lyrics based on user prompts, it overcomes creative blocks, offering tailored inspiration and enhancing the overall songwriting process with a user-friendly interface.
How I built it
The AI lyric generator in LyricMuse is built using the GPT-2 language model from the transformers library.
Flask Framework:
I utilized Flask, a web framework in Python, to create the backend of LyricMuse. Flask provides a structure for handling web requests, which allows users to interact with the AI lyric generator through a web interface.
GPT-2 Model and Tokenizer:
I integrated the GPT-2 language model, a powerful natural language processing model, to generate coherent and contextually relevant lyrics. The model and tokenizer were loaded from the transformers library, a library that provides pre-trained models for natural language processing tasks.
User Input Processing:
The web interface includes a form where users input three word/phrases to kickstart the lyric generation process. The user inputs are processed in the backend and passed to the GPT-2 model for generating lyrics.
Lyric Generation:
The "generate_song" function tokenizes the user prompts, forms a prompt string, and feeds it to the GPT-2 model. The model then generates a sequence of words, forming the AI-crafted lyrics.
Lyric Formatting:
The generated lyrics go through a formatting step to ensure clarity and readability. The "format_song" function adds line breaks and removes unnecessary spaces, enhancing the presentation of the lyrics.
Web Interface (HTML and Flask Routes):
The HTML template contains a form where users can input prompts and a container to display the generated lyrics. The Flask route ("@app.route("/")") handles user requests, triggers the lyric generation process, and updates the session with the generated lyrics.
User Session Handling:
I used Flask's session management to store and persist generated lyrics across user interactions with the web application.
Iteration and Refinement:
The development process involved iterative refinement, addressing challenges in maintaining coherence and diversity in the generated lyrics. User feedback played a crucial role in enhancing the tool's usability and effectiveness.
Challenges I ran into
One challenge I faced while developing LyricMuse was fine-tuning the AI model to strike the right balance between lyrical coherence and diversity. Achieving a harmonious blend proved intricate, requiring iterative adjustments to ensure the generated lyrics maintained both meaningful connections and creative diversity.
Accomplishments that I am proud of
An accomplishment I'm proud of is successfully creating LyricMuse as a tool that empowers artists to overcome creative hurdles. Witnessing the positive impact it had, especially during the initial user test with my friend, solidified the notion that LyricMuse could genuinely make a meaningful difference in the creative process for musicians.
What I learned
Through the process of creating LyricMuse, I gained valuable insights into AI capabilities in the world of music. Additionally, feedback taught me the importance of responsiveness and adaptability in developing user-friendly and impactful creative tools.
What's next for LyricMuse
The next steps for LyricMuse involve creating an area for users to store their generated lyrics. Furthermore, another plan is to enhance the platform with more advanced song-writing capabilities, so musicians get even better AI-generated lyrics. The ultimate goal for LyricMuse is to expand into a larger and even more user-friendly platform, catering to a broader audience of music creators, helping them get over the initial roadblock of song writing.
Built With
- flask
- gptmodel
- html
- javascript
- python
Log in or sign up for Devpost to join the conversation.