Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import torch
|
3 |
+
# Import your model classes here
|
4 |
+
|
5 |
+
# Load your models
|
6 |
+
emotion_model = 'lstm_model.h5'
|
7 |
+
recommender_model = 'knn_model.npy'
|
8 |
+
|
9 |
+
st.title("Emotion-based Song Recommender")
|
10 |
+
|
11 |
+
# User input for lyrics
|
12 |
+
lyrics = st.text_area("Enter lyrics here:")
|
13 |
+
|
14 |
+
if st.button("Recommend Songs"):
|
15 |
+
if lyrics:
|
16 |
+
# Predict emotion
|
17 |
+
emotion = emotion_model.predict(lyrics)
|
18 |
+
|
19 |
+
# Get song recommendations
|
20 |
+
recommendations = recommender_model.recommend(emotion, ...)
|
21 |
+
|
22 |
+
st.write("Emotion Detected:", emotion)
|
23 |
+
st.write("Recommended Songs:", recommendations)
|