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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -67,7 +67,7 @@ def prompt_to_layout(user_prompt, top_p, top_k, fpath=None):
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, max_length=300)
71
  output = tokenizer.batch_decode(output, skip_special_tokens=True)
72
  print(output)
73
 
@@ -135,7 +135,7 @@ def prompt_with_mutation(user_prompt, top_p, top_k, mut_rate, fpath=None):
135
  rooms = ', '.join(rooms)# + ', '
136
  new_prompt = '[User prompt] {} [Layout] {}'.format(user_prompt, rooms)
137
  input_ids = tokenizer(new_prompt, return_tensors='pt')
138
- mut_output = finetuned.generate(**input_ids, do_sample=True, top_p=top_p, top_k=top_k, max_length=400)
139
  mut_output = tokenizer.batch_decode(mut_output, skip_special_tokens=True)
140
  mut_im = mut_txt2layout(mut_output)
141
 
 
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
 
 
135
  rooms = ', '.join(rooms)# + ', '
136
  new_prompt = '[User prompt] {} [Layout] {}'.format(user_prompt, rooms)
137
  input_ids = tokenizer(new_prompt, return_tensors='pt')
138
+ mut_output = finetuned.generate(**input_ids, do_sample=True, top_p=top_p, top_k=top_k, eos_token_id=50256, max_length=400)
139
  mut_output = tokenizer.batch_decode(mut_output, skip_special_tokens=True)
140
  mut_im = mut_txt2layout(mut_output)
141