Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -138,7 +138,7 @@ def prompt_with_mutation(user_prompt, top_p, top_k, mut_rate, fpath=None):
|
|
138 |
rooms[-1] = rooms[-1].split(':')[0] + ':'
|
139 |
rooms = ', '.join(rooms)# + ', '
|
140 |
new_prompt = '[User prompt] {} [Layout] {}'.format(user_prompt, rooms)
|
141 |
-
input_ids = tokenizer(new_prompt, return_tensors='pt')
|
142 |
mut_output = finetuned.generate(**input_ids, do_sample=True, top_p=top_p, top_k=top_k, eos_token_id=50256, max_length=400)
|
143 |
mut_output = tokenizer.batch_decode(mut_output, skip_special_tokens=True)
|
144 |
mut_im = mut_txt2layout(mut_output)
|
|
|
138 |
rooms[-1] = rooms[-1].split(':')[0] + ':'
|
139 |
rooms = ', '.join(rooms)# + ', '
|
140 |
new_prompt = '[User prompt] {} [Layout] {}'.format(user_prompt, rooms)
|
141 |
+
input_ids = tokenizer(new_prompt, return_tensors='pt').to(device)
|
142 |
mut_output = finetuned.generate(**input_ids, do_sample=True, top_p=top_p, top_k=top_k, eos_token_id=50256, max_length=400)
|
143 |
mut_output = tokenizer.batch_decode(mut_output, skip_special_tokens=True)
|
144 |
mut_im = mut_txt2layout(mut_output)
|