Spaces:
Running
Running
fix mol gen
Browse files
app.py
CHANGED
|
@@ -182,7 +182,13 @@ def generate(latent_vector, mask):
|
|
| 182 |
selfies = gen_tokenizer.batch_decode(decoder_output, skip_special_tokens=True)
|
| 183 |
outs = []
|
| 184 |
for i in selfies:
|
| 185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
return outs
|
| 187 |
|
| 188 |
|
|
|
|
| 182 |
selfies = gen_tokenizer.batch_decode(decoder_output, skip_special_tokens=True)
|
| 183 |
outs = []
|
| 184 |
for i in selfies:
|
| 185 |
+
try:
|
| 186 |
+
decoded = sf.decoder(i.replace("] [", "]["))
|
| 187 |
+
outs.append(decoded)
|
| 188 |
+
except selfies.exceptions.DecoderError:
|
| 189 |
+
print(f"Error decoding SELFIES string: {i}")
|
| 190 |
+
|
| 191 |
+
#outs.append(sf.decoder(i.replace("] [", "][")))
|
| 192 |
return outs
|
| 193 |
|
| 194 |
|