Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -81,14 +81,14 @@ def run_inference(mode: str, model_name: str, num_molecules: int, seed_num: str,
|
|
| 81 |
if len(smiles_list) > 100:
|
| 82 |
raise gr.Error("You have provided more than the allowed limit of 100 molecules. Please provide 100 or fewer.")
|
| 83 |
# Write the custom SMILES to a temporary file and update config
|
| 84 |
-
|
|
|
|
| 85 |
with open(temp_input_file, "w") as f:
|
| 86 |
for s in smiles_list:
|
| 87 |
f.write(s + "\n")
|
| 88 |
config.inf_smiles = temp_input_file
|
| 89 |
config.sample_num = len(smiles_list)
|
| 90 |
# Always use a random seed for custom mode
|
| 91 |
-
config.seed = random.randint(0, 10000)
|
| 92 |
else:
|
| 93 |
# Classical Generation mode
|
| 94 |
config.sample_num = num_molecules
|
|
|
|
| 81 |
if len(smiles_list) > 100:
|
| 82 |
raise gr.Error("You have provided more than the allowed limit of 100 molecules. Please provide 100 or fewer.")
|
| 83 |
# Write the custom SMILES to a temporary file and update config
|
| 84 |
+
config.seed = random.randint(0, 10000)
|
| 85 |
+
temp_input_file = f"custom_input{config.seed}.smi"
|
| 86 |
with open(temp_input_file, "w") as f:
|
| 87 |
for s in smiles_list:
|
| 88 |
f.write(s + "\n")
|
| 89 |
config.inf_smiles = temp_input_file
|
| 90 |
config.sample_num = len(smiles_list)
|
| 91 |
# Always use a random seed for custom mode
|
|
|
|
| 92 |
else:
|
| 93 |
# Classical Generation mode
|
| 94 |
config.sample_num = num_molecules
|