Skip to content

fm1320/song-vibe

Repository files navigation

🎶 Song vibe 🎶

GitHub GitHub Repo stars GitHub forks

This is a tool that gives song recommendations based on vibes and moods. Sometimes the music and playlists we hear don't "hit" our vibe, so we are using AI to try to change that.

Technical details

A dataset of songs and their descriptions of moods and vibes is generated by promoting an LLM. Each song's vibe is encoded using a transformer model and saved as a vector index. Then this vector index is queried by similarity using the vector embedding of the user's input and the top 10 matches are returned.

Installation

Follow the instructions below to run the Streamlit server locally.

Pre-requisites

Make sure you have Python 3.10 and Poetry installed.

Steps

  1. Clone the repository
git clone https://github.com/fm1320/song-vibe
cd song-vibe
  1. Install dependencies from requirements file
poetry install
  1. (For Training a new index) The file data.csv is an example of what the training data of song descriptions looks like. This training data has been synthetically generated by prompting an LLM. By running train.py the song descriptions are encoded by a transformer network and a vector index file index.bin using FAISS is created. Currenlty a flat index is used.

Note: Make sure data is formatted properly if you are going to use your own dataset!

  1. Run the Streamlit server
poetry run streamlit run app.py

Open http://localhost:8501 in your browser to access the app.

Tech Stack

Roadmap

  • coming soon: Full web app using Spotify API and more songs
  • Support and add more synthetic song descriptions
  • Support for more transformer encoders and indices

Contributing

All contributions are welcome!

License

Free to use, star, share, and acknowledge use if you can!