Spaces:
Runtime error
Runtime error
Badr AlKhamissi
commited on
Commit
·
6e51c75
1
Parent(s):
8b61561
resolving phrase issue
Browse files
app.py
CHANGED
@@ -116,11 +116,11 @@ def set_config(semantic_concept, word, prompt_suffix, font_name, num_steps, seed
|
|
116 |
else:
|
117 |
raise gr.Error(f'letter should be in word')
|
118 |
|
119 |
-
if ' ' in cfg.word:
|
120 |
-
|
121 |
|
122 |
cfg.letter = f"{cfg.font}_{cfg.optimized_letter}_scaled"
|
123 |
-
cfg.target = f"code/data/init/{cfg.letter}"
|
124 |
|
125 |
# set experiment dir
|
126 |
signature = f"{cfg.letter}_concept_{cfg.semantic_concept}_seed_{cfg.seed}"
|
@@ -258,7 +258,7 @@ def run_main_app(semantic_concept, word, prompt_suffix, font_name, num_steps, se
|
|
258 |
save_svg.save_svg(
|
259 |
filename, w, h, shapes, shape_groups)
|
260 |
|
261 |
-
combine_word(cfg.word, cfg.optimized_letter, cfg.font, cfg.experiment_dir, device)
|
262 |
|
263 |
filename = os.path.join(cfg.experiment_dir, "final.gif")
|
264 |
imageio.mimsave(filename, np.array(gif_frames).astype(np.uint8))
|
|
|
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.replace(' ', '_')}"
|
124 |
|
125 |
# set experiment dir
|
126 |
signature = f"{cfg.letter}_concept_{cfg.semantic_concept}_seed_{cfg.seed}"
|
|
|
258 |
save_svg.save_svg(
|
259 |
filename, w, h, shapes, shape_groups)
|
260 |
|
261 |
+
# combine_word(cfg.word, cfg.optimized_letter, cfg.font, cfg.experiment_dir, device)
|
262 |
|
263 |
filename = os.path.join(cfg.experiment_dir, "final.gif")
|
264 |
imageio.mimsave(filename, np.array(gif_frames).astype(np.uint8))
|