Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
@@ -1,46 +1,38 @@
|
|
1 |
-
---
|
2 |
-
title: "PlayMyEmotions"
|
3 |
-
emoji: "๐ฎ"
|
4 |
-
colorFrom: "indigo"
|
5 |
-
colorTo: "purple"
|
6 |
-
sdk: "streamlit"
|
7 |
-
sdk_version: "1.19.0"
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
11 |
-
|
12 |
# Play My Emotions ๐ต๐ฐ๐ฎ
|
13 |
|
14 |
-
|
|
|
|
|
|
|
|
|
15 |
|
16 |
Made with [DeepLake](https://www.deeplake.ai/) ๐ and [LangChain](https://python.langchain.com/en/latest/index.html) ๐ฆโ๏ธ
|
17 |
|
18 |
-
We also used [
|
19 |
|
20 |
## How it works
|
21 |
|
22 |
The application follows a sequence of steps to deliver Disney songs matching the user's emotions:
|
23 |
-
|
|
|
24 |
- **Emotion Encoding**: The user-provided emotions are then fed to a Language Model (LLM). The LLM interprets and encodes these emotions.
|
25 |
- **Similarity Search**: These encoded emotions are utilized to perform a similarity search within our [vector database](Deep Lake Vector Store in LangChain). This database houses Disney songs, each represented as emotional embeddings.
|
26 |
- **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.
|
27 |
-
- **Song Retrieval**: The selected song's embedded player is displayed on the webpage for the user. Additionally, the LLM
|
28 |
|
29 |
## Run it
|
30 |
|
31 |
Clone this repo.
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
```
|
36 |
python -m venv .venv
|
37 |
source .venv/bin/activate
|
38 |
pip install -r requirements.txt
|
39 |
```
|
40 |
|
41 |
-
You will need the following `.env` file
|
42 |
-
|
43 |
-
```bash
|
44 |
OPENAI_API_KEY=<OPENAI_API_KEY>
|
45 |
ACTIVELOOP_TOKEN=<ACTIVELOOP_TOKEN>
|
46 |
ACTIVELOOP_ORG_ID=zuppif
|
@@ -48,7 +40,7 @@ UPSTASH_URL=<UPSTASH_URL>
|
|
48 |
UPSTASH_PASSWORD=<UPSTASH_PASSWORD>
|
49 |
```
|
50 |
|
51 |
-
If you
|
52 |
|
53 |
Then
|
54 |
|
@@ -56,4 +48,4 @@ Then
|
|
56 |
streamlit run app.py
|
57 |
```
|
58 |
|
59 |
-
Then navitage to `http://192.168.1.181:8501`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# Play My Emotions ๐ต๐ฐ๐ฎ
|
2 |
|
3 |
+
![Live Demo](PlayMyEmotions.jpeg)
|
4 |
+
|
5 |
+
The app is on [Hugging Face Spaces](https://huggingface.co/spaces/DjPapzin/PlayMyEmotions) ๐ค
|
6 |
+
|
7 |
+
This app takes a user input and suggests songs that match its emotions/vibes.
|
8 |
|
9 |
Made with [DeepLake](https://www.deeplake.ai/) ๐ and [LangChain](https://python.langchain.com/en/latest/index.html) ๐ฆโ๏ธ
|
10 |
|
11 |
+
We also used [Upstash](https://upstash.com/) to store user inputs/emotions and recommended songs.
|
12 |
|
13 |
## How it works
|
14 |
|
15 |
The application follows a sequence of steps to deliver Disney songs matching the user's emotions:
|
16 |
+
|
17 |
+
- **User Input**: The application starts by collecting the user's emotional state through a text input.
|
18 |
- **Emotion Encoding**: The user-provided emotions are then fed to a Language Model (LLM). The LLM interprets and encodes these emotions.
|
19 |
- **Similarity Search**: These encoded emotions are utilized to perform a similarity search within our [vector database](Deep Lake Vector Store in LangChain). This database houses Disney songs, each represented as emotional embeddings.
|
20 |
- **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.
|
21 |
+
- **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.
|
22 |
|
23 |
## Run it
|
24 |
|
25 |
Clone this repo.
|
26 |
|
27 |
+
Create a `venv`:
|
28 |
+
```bash
|
|
|
29 |
python -m venv .venv
|
30 |
source .venv/bin/activate
|
31 |
pip install -r requirements.txt
|
32 |
```
|
33 |
|
34 |
+
You will need the following `.env` file:
|
35 |
+
```
|
|
|
36 |
OPENAI_API_KEY=<OPENAI_API_KEY>
|
37 |
ACTIVELOOP_TOKEN=<ACTIVELOOP_TOKEN>
|
38 |
ACTIVELOOP_ORG_ID=zuppif
|
|
|
40 |
UPSTASH_PASSWORD=<UPSTASH_PASSWORD>
|
41 |
```
|
42 |
|
43 |
+
If you don't want to use upstash set the `USE_STORAGE=False`
|
44 |
|
45 |
Then
|
46 |
|
|
|
48 |
streamlit run app.py
|
49 |
```
|
50 |
|
51 |
+
Then navitage to `http://192.168.1.181:8501`
|