SpotifyProject / app.py
brendabor's picture
Update app.py
1afb4fa
raw
history blame
602 Bytes
import streamlit as st
#import torch
# Import your model classes here
# Load your models
emotion_model = 'lstm_model.h5'
recommender_model = 'knn_model.npy'
st.title("Emotion-based Song Recommender")
# User input for lyrics
lyrics = st.text_area("Enter lyrics here:")
if st.button("Recommend Songs"):
if lyrics:
# Predict emotion
emotion = emotion_model.predict(lyrics)
# Get song recommendations
recommendations = recommender_model.recommend(emotion, ...)
st.write("Emotion Detected:", emotion)
st.write("Recommended Songs:", recommendations)