JingyeChen22 commited on
Commit
b81bda4
1 Parent(s): 5d04da1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -331,7 +331,7 @@ def text_to_image(guest_id, prompt,keywords,positive_prompt,radio,slider_step,sl
331
  composed_prompt = tokenizer.decode(prompt)
332
 
333
  else:
334
- user_prompt += ' <|endoftext|>'
335
  layout_image = None
336
 
337
  for items in global_dict[guest_id]['stack']:
@@ -343,7 +343,7 @@ def text_to_image(guest_id, prompt,keywords,positive_prompt,radio,slider_step,sl
343
  x = x // 4
344
  y = y // 4
345
  text_str = ' '.join([f'[{c}]' for c in list(text)])
346
- user_prompt += f'<|startoftext|> l{x} t{y} {text_str} <|endoftext|>'
347
  elif len(position) == 4:
348
  x0, y0, x1, y1 = position
349
  x0 = x0 // 4
@@ -351,7 +351,7 @@ def text_to_image(guest_id, prompt,keywords,positive_prompt,radio,slider_step,sl
351
  x1 = x1 // 4
352
  y1 = y1 // 4
353
  text_str = ' '.join([f'[{c}]' for c in list(text)])
354
- user_prompt += f'<|startoftext|> l{x0} t{y0} r{x1} b{y1} {text_str} <|endoftext|>'
355
 
356
  # composed_prompt = user_prompt
357
  prompt = tokenizer.encode(user_prompt)
 
331
  composed_prompt = tokenizer.decode(prompt)
332
 
333
  else:
334
+ user_prompt += ' <|endoftext|><|startoftext|>'
335
  layout_image = None
336
 
337
  for items in global_dict[guest_id]['stack']:
 
343
  x = x // 4
344
  y = y // 4
345
  text_str = ' '.join([f'[{c}]' for c in list(text)])
346
+ user_prompt += f' l{x} t{y} {text_str} <|endoftext|>'
347
  elif len(position) == 4:
348
  x0, y0, x1, y1 = position
349
  x0 = x0 // 4
 
351
  x1 = x1 // 4
352
  y1 = y1 // 4
353
  text_str = ' '.join([f'[{c}]' for c in list(text)])
354
+ user_prompt += f' l{x0} t{y0} r{x1} b{y1} {text_str} <|endoftext|>'
355
 
356
  # composed_prompt = user_prompt
357
  prompt = tokenizer.encode(user_prompt)