Spaces:
Sleeping
Sleeping
Avoid coord error with lacking ":".
Browse files
app.py
CHANGED
@@ -90,7 +90,11 @@ def prompt_to_layout(user_prompt, intensity, fpath=None):
|
|
90 |
output = tokenizer.batch_decode(output, skip_special_tokens=True)
|
91 |
layout = output[0].split('[User prompt]')[1].split('[Layout] ')[1].split(', ')
|
92 |
spaces = [txt.split(':')[0] for txt in layout]
|
93 |
-
coords = [
|
|
|
|
|
|
|
|
|
94 |
coordinates = [re.findall(regex, coord) for coord in coords]
|
95 |
|
96 |
num_coords = []
|
|
|
90 |
output = tokenizer.batch_decode(output, skip_special_tokens=True)
|
91 |
layout = output[0].split('[User prompt]')[1].split('[Layout] ')[1].split(', ')
|
92 |
spaces = [txt.split(':')[0] for txt in layout]
|
93 |
+
coords = []
|
94 |
+
for txt in layout:
|
95 |
+
if ':' in txt:
|
96 |
+
split_txt = txt.split(':')
|
97 |
+
coords.append(split_txt[1].rstrip())
|
98 |
coordinates = [re.findall(regex, coord) for coord in coords]
|
99 |
|
100 |
num_coords = []
|