Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -489,15 +489,16 @@ def MoleculeAgent(smiles, name, task):
|
|
| 489 |
for c in graph.stream(input): #, stream_mode='updates'):
|
| 490 |
m = re.findall(r'[a-z]+\_node', str(c))
|
| 491 |
if len(m) != 0:
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
|
|
|
| 501 |
#check if image exists
|
| 502 |
if os.path.exists('Similars_image.png'):
|
| 503 |
img_loc = 'Similars_image.png'
|
|
|
|
| 489 |
for c in graph.stream(input): #, stream_mode='updates'):
|
| 490 |
m = re.findall(r'[a-z]+\_node', str(c))
|
| 491 |
if len(m) != 0:
|
| 492 |
+
try:
|
| 493 |
+
reply = c[str(m[0])]['messages']
|
| 494 |
+
print("======== DEBUG ================")
|
| 495 |
+
print(c)
|
| 496 |
+
if 'assistant' in str(reply):
|
| 497 |
+
reply = str(reply).split("<|assistant|>")[-1].split('#')[0].strip()
|
| 498 |
+
replies.append(reply)
|
| 499 |
+
except:
|
| 500 |
+
reply = str(c).split("<|assistant|>")[-1].split('#')[0].strip()
|
| 501 |
+
replies.append(reply)
|
| 502 |
#check if image exists
|
| 503 |
if os.path.exists('Similars_image.png'):
|
| 504 |
img_loc = 'Similars_image.png'
|