omer11a commited on
Commit
f0d244c
·
1 Parent(s): 5368ac9

Fixed bug in input parsing

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -69,7 +69,7 @@ def inference(
69
 
70
  seed_everything(seed)
71
  start_code = torch.randn([len(prompts), 4, 128, 128], device=device)
72
- eos_token_index = num_tokens + 1
73
 
74
  editor = BoundedAttention(
75
  boxes,
@@ -230,6 +230,8 @@ def main():
230
  gr.HTML(COPY_LINK)
231
 
232
  with gr.Column():
 
 
233
  prompt = gr.Textbox(
234
  label="Text prompt",
235
  )
@@ -336,7 +338,10 @@ def main():
336
 
337
  with gr.Column():
338
  gr.Examples(
339
- examples=[["a ginger kitten and a gray puppy in a yard", "2,3;6,7", "1,4,5,8,9", "10"]],
 
 
 
340
  inputs=[prompt, subject_token_indices, filter_token_indices, num_tokens],
341
  )
342
 
 
69
 
70
  seed_everything(seed)
71
  start_code = torch.randn([len(prompts), 4, 128, 128], device=device)
72
+ eos_token_index = None if num_tokens is None else num_tokens + 1
73
 
74
  editor = BoundedAttention(
75
  boxes,
 
230
  gr.HTML(COPY_LINK)
231
 
232
  with gr.Column():
233
+ gr.HTML("Scroll down to see examples of the required input format.")
234
+
235
  prompt = gr.Textbox(
236
  label="Text prompt",
237
  )
 
338
 
339
  with gr.Column():
340
  gr.Examples(
341
+ examples=[
342
+ ["a ginger kitten and a gray puppy in a yard", "2,3;6,7", "1,4,5,8,9", "10"],
343
+ ["a realistic photo of a highway with a semi trailer and a concrete mixer and a helicopter", "9,10;13,14;17", "1,4,5,7,8,11,12,15,16", "17"],
344
+ ],
345
  inputs=[prompt, subject_token_indices, filter_token_indices, num_tokens],
346
  )
347