Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -105,7 +105,7 @@ def smiles_node(state: State) -> State:
|
|
| 105 |
smiles_string = f'The SMILES string for the molecule is: {smiles}\n'
|
| 106 |
except:
|
| 107 |
smiles = "unknown"
|
| 108 |
-
smiles_string = '
|
| 109 |
|
| 110 |
state["query_smiles"] = smiles
|
| 111 |
|
|
@@ -166,7 +166,7 @@ def similars_node(state: State) -> State:
|
|
| 166 |
# outf.write(pic)
|
| 167 |
img.save(filename)
|
| 168 |
except:
|
| 169 |
-
props_string = '
|
| 170 |
filename = None
|
| 171 |
|
| 172 |
current_props_string += props_string
|
|
@@ -238,7 +238,7 @@ returns the names, SMILES strings, molecular weights and logP values for the sim
|
|
| 238 |
|
| 239 |
res = chat_model.invoke(prompt)
|
| 240 |
|
| 241 |
-
tool_choices = str(res).split('<|assistant|>')[1].split('#')[0].strip()
|
| 242 |
tool_choices = tool_choices.split(',')
|
| 243 |
if len(tool_choices) == 1:
|
| 244 |
if tool_choices[0].strip().lower() == 'none':
|
|
|
|
| 105 |
smiles_string = f'The SMILES string for the molecule is: {smiles}\n'
|
| 106 |
except:
|
| 107 |
smiles = "unknown"
|
| 108 |
+
smiles_string = 'Look further.\n'
|
| 109 |
|
| 110 |
state["query_smiles"] = smiles
|
| 111 |
|
|
|
|
| 166 |
# outf.write(pic)
|
| 167 |
img.save(filename)
|
| 168 |
except:
|
| 169 |
+
props_string = 'Look further.\n'
|
| 170 |
filename = None
|
| 171 |
|
| 172 |
current_props_string += props_string
|
|
|
|
| 238 |
|
| 239 |
res = chat_model.invoke(prompt)
|
| 240 |
|
| 241 |
+
tool_choices = str(res).replace('smilars', 'similars').split('<|assistant|>')[1].split('#')[0].strip()
|
| 242 |
tool_choices = tool_choices.split(',')
|
| 243 |
if len(tool_choices) == 1:
|
| 244 |
if tool_choices[0].strip().lower() == 'none':
|