mirror of
https://github.com/InternLM/InternBootcamp.git
synced 2026-04-19 12:58:04 +00:00
refactor(bootcamp): simplify InChI and SMILES generation
- Reduce the number of generated InChIs and SMILES from 10 to 1 - Remove random selection, always return the first generated structure - Comment out debug prints and unused code
This commit is contained in:
parent
f4913c6f02
commit
18f47e0a3a
3 changed files with 7 additions and 8 deletions
|
|
@ -113,7 +113,7 @@ class InChIGenerator:
|
|||
except Exception as e:
|
||||
# This can happen if the molecule is somehow malformed even after sanitization,
|
||||
# or if InChI generation itself encounters an issue (rare).
|
||||
print(f"Debug: MolToInchi failed: {e} for SMILES: {Chem.MolToSmiles(mol)}")
|
||||
# print(f"Debug: MolToInchi failed: {e} for SMILES: {Chem.MolToSmiles(mol)}")
|
||||
pass
|
||||
|
||||
return list(valid_inchi_set)
|
||||
|
|
@ -244,7 +244,7 @@ class SMILESGenerator:
|
|||
valid_smiles_set = set()
|
||||
total_attempts_overall = 0
|
||||
|
||||
print(f"Attempting to generate {n} valid SMILES (min_len={self.min_len}, max_len={self.max_len})...")
|
||||
# print(f"Attempting to generate {n} valid SMILES (min_len={self.min_len}, max_len={self.max_len})...")
|
||||
while len(valid_smiles_set) < n:
|
||||
attempts_for_current_smiles = 0
|
||||
generated_this_round = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue