mgyigit commited on
Commit
724b603
1 Parent(s): c81f62d

Update gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +5 -5
gradio_app.py CHANGED
@@ -53,13 +53,13 @@ def function(model_name: str, num_molecules: int, seed_num: int) -> tuple[PIL.Im
53
  config = model_configs[model_name]
54
  config.sample_num = num_molecules
55
 
56
- if seed_num is not None or seed_num != '':
 
 
57
  try:
58
  config.seed = int(seed_num)
59
- except ValueError:
60
- raise gr.Warning("The seed must be an integer value!")
61
- else:
62
- config.seed = random.randint(0, 10000)
63
 
64
 
65
  inferer = Inference(config)
 
53
  config = model_configs[model_name]
54
  config.sample_num = num_molecules
55
 
56
+ if seed_num is None or seed_num.strip() == "":
57
+ config.seed = random.randint(0, 10000)
58
+ else:
59
  try:
60
  config.seed = int(seed_num)
61
+ except ValueError:
62
+ raise gr.Error("The seed must be an integer value!")
 
 
63
 
64
 
65
  inferer = Inference(config)