Hi! Brand new to Streamlit and trying to figure out how to convert something I built in Google Colab to Streamlit.
I am trying to allow a user to input a set of words, and receive as output a word most similar to the set. To do this, I’m using gensim.downloader to pull in word2vec-google-news-300 and using the “most_similar” function. I am trying to cache this process in a function “load_model()” function so that the user does not need to download the gensim model every time they want to input a new word to try.
However, it is not working (it seems to stall out every time and never reach success). Any suggestions?
@st.cache() def load_model(): with st.spinner('Downloading word2vec model... please hold...'): model = api.load('word2vec-google-news-300') return model def main(): model = load_model() st.success('Done!')