wilmerags commited on
Commit
d099a9b
Β·
1 Parent(s): dded833

fix: Fix spontaneous file not found error for cache

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -201,7 +201,10 @@ with col2:
201
  go_btn = st.button('Visualize πŸš€')
202
 
203
  with st.spinner(text="Loading brain... 🧠"):
204
- model = load_model(model_to_use[expected_lang])
 
 
 
205
 
206
  if go_btn and tw_user != '':
207
  tw_user = tw_user.replace(' ', '')
 
201
  go_btn = st.button('Visualize πŸš€')
202
 
203
  with st.spinner(text="Loading brain... 🧠"):
204
+ try:
205
+ model = load_model(model_to_use[expected_lang])
206
+ except FileNotFoundError:
207
+ model = SentenceTransformer(model_to_use[expected_lang])
208
 
209
  if go_btn and tw_user != '':
210
  tw_user = tw_user.replace(' ', '')