THEODOROS commited on
Commit
c616786
·
1 Parent(s): f463d0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -88,7 +88,7 @@ def prompt_to_layout(user_prompt, intensity, fpath=None):
88
  output = tokenizer.batch_decode(output, skip_special_tokens=True)
89
  layout = output[0].split('[User prompt]')[1].split('[Layout] ')[1].split(', ')
90
  spaces = [txt.split(':')[0] for txt in layout]
91
- coords = [txt.split(':')[1] for txt in layout]
92
  coordinates = [re.findall(regex, coord) for coord in coords]
93
  layout_dict = dict(zip(spaces, coords))
94
  polygons = []
 
88
  output = tokenizer.batch_decode(output, skip_special_tokens=True)
89
  layout = output[0].split('[User prompt]')[1].split('[Layout] ')[1].split(', ')
90
  spaces = [txt.split(':')[0] for txt in layout]
91
+ coords = [txt.split(':')[1].rstrip() for txt in layout]
92
  coordinates = [re.findall(regex, coord) for coord in coords]
93
  layout_dict = dict(zip(spaces, coords))
94
  polygons = []