Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -356,9 +356,7 @@ CONTEXT: {props_string}.\n \
|
|
| 356 |
'
|
| 357 |
|
| 358 |
res = chat_model.invoke(check_prompt)
|
| 359 |
-
|
| 360 |
-
print(res)
|
| 361 |
-
print('*'*50)
|
| 362 |
if str(res).split('<|assistant|>')[1].split('#')[0].strip().lower() == "loop":
|
| 363 |
state["loop_again"] = "loop_again"
|
| 364 |
return state
|
|
@@ -375,8 +373,7 @@ CONTEXT: {props_string}.\n \
|
|
| 375 |
QUERY_TASK: {query_task}.\n '
|
| 376 |
|
| 377 |
res = chat_model.invoke(prompt)
|
| 378 |
-
|
| 379 |
-
print(res)
|
| 380 |
return {"messages": res}
|
| 381 |
|
| 382 |
def reflect_node(state: State) -> State:
|
|
@@ -397,8 +394,7 @@ PREVIOUS ANSWER: {previous_answer}.\n \
|
|
| 397 |
TOOL RESULTS: {props_string}. '
|
| 398 |
|
| 399 |
res = chat_model.invoke(prompt)
|
| 400 |
-
|
| 401 |
-
print(res)
|
| 402 |
return {"messages": res}
|
| 403 |
|
| 404 |
def get_chemtool(state):
|
|
@@ -503,8 +499,6 @@ def MoleculeAgent(task, smiles, name):
|
|
| 503 |
if len(m) != 0:
|
| 504 |
try:
|
| 505 |
reply = c[str(m[0])]['messages']
|
| 506 |
-
print("======== DEBUG ================")
|
| 507 |
-
print(c)
|
| 508 |
if 'assistant' in str(reply):
|
| 509 |
reply = str(reply).split("<|assistant|>")[-1].split('#')[0].strip()
|
| 510 |
replies.append(reply)
|
|
@@ -524,7 +518,7 @@ def MoleculeAgent(task, smiles, name):
|
|
| 524 |
with gr.Blocks(fill_height=True) as forest:
|
| 525 |
gr.Markdown('''
|
| 526 |
# Molecule Agent - calls the PubChem API to:
|
| 527 |
-
-
|
| 528 |
- fetch SMILES
|
| 529 |
- find similar molecules
|
| 530 |
''')
|
|
|
|
| 356 |
'
|
| 357 |
|
| 358 |
res = chat_model.invoke(check_prompt)
|
| 359 |
+
|
|
|
|
|
|
|
| 360 |
if str(res).split('<|assistant|>')[1].split('#')[0].strip().lower() == "loop":
|
| 361 |
state["loop_again"] = "loop_again"
|
| 362 |
return state
|
|
|
|
| 373 |
QUERY_TASK: {query_task}.\n '
|
| 374 |
|
| 375 |
res = chat_model.invoke(prompt)
|
| 376 |
+
|
|
|
|
| 377 |
return {"messages": res}
|
| 378 |
|
| 379 |
def reflect_node(state: State) -> State:
|
|
|
|
| 394 |
TOOL RESULTS: {props_string}. '
|
| 395 |
|
| 396 |
res = chat_model.invoke(prompt)
|
| 397 |
+
|
|
|
|
| 398 |
return {"messages": res}
|
| 399 |
|
| 400 |
def get_chemtool(state):
|
|
|
|
| 499 |
if len(m) != 0:
|
| 500 |
try:
|
| 501 |
reply = c[str(m[0])]['messages']
|
|
|
|
|
|
|
| 502 |
if 'assistant' in str(reply):
|
| 503 |
reply = str(reply).split("<|assistant|>")[-1].split('#')[0].strip()
|
| 504 |
replies.append(reply)
|
|
|
|
| 518 |
with gr.Blocks(fill_height=True) as forest:
|
| 519 |
gr.Markdown('''
|
| 520 |
# Molecule Agent - calls the PubChem API to:
|
| 521 |
+
- fetch names
|
| 522 |
- fetch SMILES
|
| 523 |
- find similar molecules
|
| 524 |
''')
|