Spaces:
Sleeping
Sleeping
Update app.py
Browse files80 unmodified lines818283848586878889909192939480 unmodified linesif len(smiles_list) > 100:raise gr.Error("You have provided more than the allowed limit of 100 molecules. Please provide 100 or fewer.")# Write the custom SMILES to a temporary file and update configtemp_input_file = "custom_input.smi"with open(temp_input_file, "w") as f:for s in smiles_list:f.write(s + "\n")config.inf_smiles = temp_input_fileconfig.sample_num = len(smiles_list)# Always use a random seed for custom modeconfig.seed = random.randint(0, 10000)else:# Classical Generation modeconfig.sample_num = num_molecules80 unmodified lines818283848586878889909192939480 unmodified linesif len(smiles_list) > 100:raise gr.Error("You have provided more than the allowed limit of 100 molecules. Please provide 100 or fewer.")# Write the custom SMILES to a temporary file and update configconfig.seed = random.randint(0, 10000)temp_input_file = f"custom_input{config.seed}.smi"with open(temp_input_file, "w") as f:for s in smiles_list:f.write(s + "\n")config.inf_smiles = temp_input_fileconfig.sample_num = len(smiles_list)# Always use a random seed for custom modeelse:# Classical Generation modeconfig.sample_num = num_molecules
app.py+2-2