xuyingli commited on
Commit
8f74fa3
1 Parent(s): aad2185

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -288,7 +288,7 @@ with st.spinner("Connecting DB..."):
288
  with st.spinner("Loading Models..."):
289
  # Initialize SAGE model
290
  if 'xq' not in st.session_state:
291
- model, alphabet = init_esm()
292
  batch_converter = alphabet.get_batch_converter()
293
  st.session_state['batch'] = batch_converter
294
  st.session_state.query_num = 0
@@ -383,7 +383,10 @@ else:
383
  st.title("Evolutionary Scale Modeling")
384
  start = [st.empty(), st.empty(), st.empty(), st.empty(), st.empty(), st.empty(), st.empty(), st.empty(), st.empty()]
385
  start[0].info(msg)
386
- option = st.selectbox('Application options', ('self-contact prediction', 'search the database', 'activity prediction','PDB viewer'))
 
 
 
387
 
388
  st.session_state.db_name_ref = 'default.esm_protein'
389
  if option == 'self-contact prediction':
@@ -411,9 +414,7 @@ else:
411
 
412
  if sequence:
413
  st.write('you have entered: ', sequence)
414
- st.session_state['xq'] = model
415
- batch_converter = alphabet.get_batch_converter()
416
- result_temp_seq = esm_search(st.session_state['xq'], sequence, batch_converter ,top_k=10)
417
  st.text('search result (top 5): ')
418
  # tab1, tab2, tab3, tab4, = st.tabs(["Cat", "Dog", "Owl"])
419
  tab1, tab2, tab3 , tab4, tab5 = st.tabs(['1','2','3','4','5'])
 
288
  with st.spinner("Loading Models..."):
289
  # Initialize SAGE model
290
  if 'xq' not in st.session_state:
291
+ st.session_state.model, st.session_state.alphabet = init_esm()
292
  batch_converter = alphabet.get_batch_converter()
293
  st.session_state['batch'] = batch_converter
294
  st.session_state.query_num = 0
 
383
  st.title("Evolutionary Scale Modeling")
384
  start = [st.empty(), st.empty(), st.empty(), st.empty(), st.empty(), st.empty(), st.empty(), st.empty(), st.empty()]
385
  start[0].info(msg)
386
+ option = st.selectbox('Application options', ('self-contact prediction',
387
+ 'search the database for similar proteins',
388
+ 'activity prediction with similar proteins',
389
+ 'PDB viewer'))
390
 
391
  st.session_state.db_name_ref = 'default.esm_protein'
392
  if option == 'self-contact prediction':
 
414
 
415
  if sequence:
416
  st.write('you have entered: ', sequence)
417
+ result_temp_seq = esm_search(st.session_state.model, sequence, st.session_state.batch_converter ,top_k=10)
 
 
418
  st.text('search result (top 5): ')
419
  # tab1, tab2, tab3, tab4, = st.tabs(["Cat", "Dog", "Owl"])
420
  tab1, tab2, tab3 , tab4, tab5 = st.tabs(['1','2','3','4','5'])