sagawa commited on
Commit
5a04251
·
1 Parent(s): 6fbda13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -15,18 +15,18 @@ import rdkit
15
  import streamlit as st
16
 
17
  st.title('predictproduct-t5')
18
- st.markdown('### At this space, you can predict the products of reactions from their inputs.')
19
- st.markdown('### The format of the string is like "REACTANT:{reactants of the reaction}CATALYST:{catalysts of the reaction}REAGENT:{reagents of the reaction}SOLVENT:{solvent of the reaction}".')
20
- st.markdown('### If there are no catalyst or reagent, fill the blank with a space. And if there are multiple reactants, concatenate them with "."')
21
  display_text = 'input the reaction smiles (e.g. REACTANT:CNc1nc(SC)ncc1CO.O.O=[Cr](=O)([O-])O[Cr](=O)(=O)[O-].[Na+]CATALYST: REAGENT: SOLVENT:CC(=O)O)'
22
 
23
  class CFG():
 
24
  uploaded_file = st.file_uploader("Choose a CSV file")
25
  input_data = st.text_area(display_text)
26
  model_name_or_path = 'sagawa/ZINC-t5-productpredicition'
27
  model = 't5'
28
  num_beams = st.number_input(label='num beams', min_value=1, max_value=10, value=5, step=1)
29
- num_return_sequences = st.number_input(label='num return sequences', min_value=1, max_value=num_beams, value=num_beams, step=1)
30
  seed = 42
31
 
32
 
 
15
  import streamlit as st
16
 
17
  st.title('predictproduct-t5')
18
+ st.markdown('#### At this space, you can predict the products of reactions from their inputs.')
19
+ st.markdown('#### The code expects input_data as a string or CSV file that contains an "input" column. The format of the string or contents of the column are like "REACTANT:{reactants of the reaction}CATALYST:{catalysts of the reaction}REAGENT:{reagents of the reaction}SOLVENT:{solvent of the reaction}".')
20
+ st.markdown('#### If there are no catalyst or reagent, fill the blank with a space. And if there are multiple reactants, concatenate them with "."')
21
  display_text = 'input the reaction smiles (e.g. REACTANT:CNc1nc(SC)ncc1CO.O.O=[Cr](=O)([O-])O[Cr](=O)(=O)[O-].[Na+]CATALYST: REAGENT: SOLVENT:CC(=O)O)'
22
 
23
  class CFG():
24
+ num_return_sequences = num_beams
25
  uploaded_file = st.file_uploader("Choose a CSV file")
26
  input_data = st.text_area(display_text)
27
  model_name_or_path = 'sagawa/ZINC-t5-productpredicition'
28
  model = 't5'
29
  num_beams = st.number_input(label='num beams', min_value=1, max_value=10, value=5, step=1)
 
30
  seed = 42
31
 
32