xuandin commited on
Commit
1faa78e
·
verified ·
1 Parent(s): 042e3b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -271,12 +271,10 @@ with st.container():
271
  os.environ["MKL_NUM_THREADS"] = str(num_threads)
272
 
273
  # Load models once and keep them in memory
274
- if 'models_loaded' not in st.session_state:
275
- with st.spinner("Loading models..."):
276
- tokenizer_qatc, model_qatc = load_model(qatc_model_name, QATCForQuestionAnswering, device=DEVICE)
277
- tokenizer_bc, model_bc = load_model(bc_model_name, ClaimModelForClassification, is_bc=True, device=DEVICE)
278
- tokenizer_tc, model_tc = load_model(tc_model_name, ClaimModelForClassification, device=DEVICE)
279
- st.session_state.models_loaded = True
280
 
281
  # Store verification history
282
  if 'history' not in st.session_state:
 
271
  os.environ["MKL_NUM_THREADS"] = str(num_threads)
272
 
273
  # Load models once and keep them in memory
274
+ tokenizer_qatc, model_qatc = load_model(qatc_model_name, QATCForQuestionAnswering, device=DEVICE)
275
+ tokenizer_bc, model_bc = load_model(bc_model_name, ClaimModelForClassification, is_bc=True, device=DEVICE)
276
+ tokenizer_tc, model_tc = load_model(tc_model_name, ClaimModelForClassification, device=DEVICE)
277
+ st.session_state.models_loaded = True
 
 
278
 
279
  # Store verification history
280
  if 'history' not in st.session_state: