THEODOROS commited on
Commit
fe945ab
·
1 Parent(s): 4610e39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -65,11 +65,11 @@ def draw_polygons(polygons, colors, im_size=(256, 256), b_color="white", fpath=N
65
  def prompt_to_layout(user_prompt, top_p, top_k, fpath=None):
66
 
67
  model_prompt = '[User prompt] {} [Layout]'.format(user_prompt)
68
- print(model_prompt)
69
  input_ids = tokenizer(model_prompt, return_tensors='pt')
70
  output = finetuned.generate(**input_ids, do_sample=True, top_p=top_p, top_k=top_k, eos_token_id=50256, max_length=400)
71
  output = tokenizer.batch_decode(output, skip_special_tokens=True)
72
- print(output)
73
 
74
  layout = output[0].lstrip().split('[User prompt]')[1].split('[Layout]')[1].split(', ')
75
  spaces = [txt.split(':')[0] for txt in layout]
 
65
  def prompt_to_layout(user_prompt, top_p, top_k, fpath=None):
66
 
67
  model_prompt = '[User prompt] {} [Layout]'.format(user_prompt)
68
+ #print(model_prompt)
69
  input_ids = tokenizer(model_prompt, return_tensors='pt')
70
  output = finetuned.generate(**input_ids, do_sample=True, top_p=top_p, top_k=top_k, eos_token_id=50256, max_length=400)
71
  output = tokenizer.batch_decode(output, skip_special_tokens=True)
72
+ #print(output)
73
 
74
  layout = output[0].lstrip().split('[User prompt]')[1].split('[Layout]')[1].split(', ')
75
  spaces = [txt.split(':')[0] for txt in layout]