cafierom commited on
Commit
ff4acd5
·
verified ·
1 Parent(s): 5f0d34c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -142,7 +142,6 @@ def similars_node(state: State) -> State:
142
  print('Not enough information to run similars tool')
143
  return state
144
 
145
- props_string = 'Found Similar compounds: \n'
146
  sub_smiles = []
147
 
148
  i = 0
@@ -295,7 +294,7 @@ Returns the names, SMILES strings, molecular weights and logP values for the sim
295
 
296
  res = chat_model.invoke(prompt)
297
 
298
- tool_choices = str(res).split('<|assistant|>')[1].split('#')[0].strip()
299
  tool_choices = tool_choices.split(',')
300
  if len(tool_choices) == 1:
301
  if tool_choices[0].strip().lower() == 'none':
@@ -513,8 +512,10 @@ def MoleculeAgent(smiles, name, task):
513
 
514
  with gr.Blocks(fill_height=True) as forest:
515
  gr.Markdown('''
516
- # Molecule Agent - fetches names and SMILES from PubChem or finds
517
- similar molecules.
 
 
518
  ''')
519
 
520
  name, smiles = None, None
 
142
  print('Not enough information to run similars tool')
143
  return state
144
 
 
145
  sub_smiles = []
146
 
147
  i = 0
 
294
 
295
  res = chat_model.invoke(prompt)
296
 
297
+ tool_choices = str(res).replace('smilars', 'similars').split('<|assistant|>')[1].split('#')[0].strip()
298
  tool_choices = tool_choices.split(',')
299
  if len(tool_choices) == 1:
300
  if tool_choices[0].strip().lower() == 'none':
 
512
 
513
  with gr.Blocks(fill_height=True) as forest:
514
  gr.Markdown('''
515
+ # Molecule Agent - calls the PubChem API to:
516
+ - fetche names
517
+ - fetch SMILES
518
+ - find similar molecules
519
  ''')
520
 
521
  name, smiles = None, None