Badr AlKhamissi commited on
Commit
8b61561
1 Parent(s): aaf94ae

resolving phrase issue

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -106,10 +106,8 @@ def set_config(semantic_concept, word, prompt_suffix, font_name, num_steps, seed
106
  cfg.loss.tone.dist_loss_weight = int(dist_loss_weight)
107
  cfg.loss.tone.pixel_dist_kernel_blur = int(pixel_dist_kernel_blur)
108
  cfg.loss.tone.pixel_dist_sigma = int(pixel_dist_sigma)
109
- cfg.loss.conformal.angeles_w = angeles_w
110
-
111
- # if ' ' in cfg.word:
112
- # raise gr.Error(f'should be only one word')
113
 
114
  cfg.caption = f"a {cfg.semantic_concept}. {cfg.prompt_suffix}"
115
  cfg.log_dir = f"output/{cfg.experiment}_{cfg.word}"
@@ -118,6 +116,9 @@ def set_config(semantic_concept, word, prompt_suffix, font_name, num_steps, seed
118
  else:
119
  raise gr.Error(f'letter should be in word')
120
 
 
 
 
121
  cfg.letter = f"{cfg.font}_{cfg.optimized_letter}_scaled"
122
  cfg.target = f"code/data/init/{cfg.letter}"
123
 
 
106
  cfg.loss.tone.dist_loss_weight = int(dist_loss_weight)
107
  cfg.loss.tone.pixel_dist_kernel_blur = int(pixel_dist_kernel_blur)
108
  cfg.loss.tone.pixel_dist_sigma = int(pixel_dist_sigma)
109
+ cfg.loss.conformal.angeles_w = angeles_w
110
+
 
 
111
 
112
  cfg.caption = f"a {cfg.semantic_concept}. {cfg.prompt_suffix}"
113
  cfg.log_dir = f"output/{cfg.experiment}_{cfg.word}"
 
116
  else:
117
  raise gr.Error(f'letter should be in word')
118
 
119
+ if ' ' in cfg.word:
120
+ cfg.optimized_letter = cfg.optimized_letter.replace(' ', '_')
121
+
122
  cfg.letter = f"{cfg.font}_{cfg.optimized_letter}_scaled"
123
  cfg.target = f"code/data/init/{cfg.letter}"
124