import streamlit as st from streamlit import session_state as session from src.config.configs import ProjectPaths import numpy as np from src.laion_clap.inference import AudioEncoder @st.cache(persist=True, show_spinner=False, suppress_st_warning=True) def load_data(): vectors = np.load(ProjectPaths.DATA_DIR.joinpath("vectors", "audio_representations.npy")) return vectors recommender = AudioEncoder() audio_vectors = load_data() dataframe = None st.title(""" Curate me a Playlist. """) st.text("") st.text("") st.text("") st.text("") session.text_input = st.text(label="Describe a playlist") st.text("") st.text("") session.slider_count = st.slider(label="movie_count", min_value=5, max_value=50) st.text("") st.text("") buffer1, col1, buffer2 = st.columns([1.45, 1, 1]) is_clicked = col1.button(label="Curate") if is_clicked: text_embed = recommender.get_text_embedding(session.text_input) st.text("") st.text("") st.text("") st.text("") if dataframe is not None: st.table(dataframe)