CoolFace
Apppublic

mchockal/TaylorSwiftDJ

sourceHugging Facecreativeml-openrail-mupdated 3y agoView on Hugging Face
1likes
App README

TaylorSwiftDJ ๐ŸŒŸ

<small>Made with [DeepLake](https://www.deeplake.ai/) ๐Ÿš€ and [LangChain](https://python.langchain.com/en/latest/index.html) ๐Ÿฆœโ›“๏ธ</small>

๐Ÿ’ซ Hey there Swifties! Welcome to "TaylorSwiftDJ"! ๐ŸŽค๐ŸŽถ \ This streamlit powered app recommends Taylor Swift's iconic songs 'tailored'(hah! :D) to your emotions. \ Dance, reminisce, and embrace your feelings with every beat โ€“ because life's a melody, and Taylor's your DJ. โœจ ๐ŸŒˆ ๐Ÿ’–

How it works

The application follows a sequence of steps to deliver Taylor Swift songs matching the user's emotions:

  • โ€”User Input: The application starts by collecting user's emotional state through a text input.
  • โ€”Emotion Encoding: The user-provided emotions are then fed to a Language Model (LLM). The LLM interprets and encodes these emotions.
  • โ€”Similarity Search: These encoded emotions are utilized to perform a similarity search within our vector database. This database houses ~130 Taylor Swift songs, each represented as emotional embeddings.
  • โ€”Song Selection: From the pool of top matching songs, the application randomly selects one. The selection is weighted, giving preference to songs with higher similarity scores.
  • โ€”Song Retrieval: The selected song's embedded player is displayed on the webpage for the user. Additionally, the LLM interpreted emotional state associated with the chosen song is displayed.

Setup instructions

Checkout the repo

Clone the repository using the following command:

git clone https://huggingface.co/spaces/mchockal/TaylorSwiftDJ

Set Environment Variables

You'll need to set the following variables in the env_vars.env file:

dotenv
OPENAI_API_KEY=
ACTIVELOOP_TOKEN=
ACTIVELOOP_ORG_ID=
MODEL = "text-embedding-ada-002"
DATASET = <your_vector_space_for_emotions>
UPSTASH_URL= 
UPSTASH_PASSWORD=
USE_STORAGE="False"
ROOT=

Install Dependencies

Install the required dependencies using the following command:

pip install -r requirements.txt

Run the Streamlit App

Launch the Streamlit app using the following command:

streamlit run app.py

<small>DISCLAIMER: This project is 200% inspired by Francesco's FairyTaleDJ. </small>