Anonymous commited on
Commit
144c63e
1 Parent(s): 9f9e664

add spaces

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -40,7 +40,7 @@ def check_move(trajectory, video_length=16):
40
 
41
  return True
42
 
43
- @spaces.GPU(duration=120)
44
  def infer(*user_args):
45
  prompt_in = user_args[0]
46
  target_indices = user_args[1]
@@ -86,7 +86,10 @@ def infer(*user_args):
86
  w_relative = i[2] * w_remain
87
  input_traj.append([i[0], h_relative, h_relative+height_ratio, w_relative, w_relative+width_ratio])
88
 
89
- indices_list = target_indices.split(',')
 
 
 
90
  idx_list = []
91
  for i in indices_list:
92
  idx_list.append(int(i))
@@ -575,7 +578,7 @@ with gr.Blocks(css=css) as demo:
575
  with gr.Group():
576
  with gr.Row():
577
  prompt_in = gr.Textbox(label="Prompt", placeholder="A corgi running on the grassland on the grassland.", scale = 3)
578
- target_indices = gr.Textbox(label="Target Indices", placeholder="1,2", scale = 1)
579
 
580
  with gr.Row():
581
  radio_mode = gr.Radio(label='Trajectory Mode', choices = ['demo', 'diy', 'ori'], scale = 1)
 
40
 
41
  return True
42
 
43
+ @spaces.GPU(duration=600)
44
  def infer(*user_args):
45
  prompt_in = user_args[0]
46
  target_indices = user_args[1]
 
86
  w_relative = i[2] * w_remain
87
  input_traj.append([i[0], h_relative, h_relative+height_ratio, w_relative, w_relative+width_ratio])
88
 
89
+ if len(target_indices) < 1:
90
+ indices_list = [1, 2]
91
+ else:
92
+ indices_list = target_indices.split(',')
93
  idx_list = []
94
  for i in indices_list:
95
  idx_list.append(int(i))
 
578
  with gr.Group():
579
  with gr.Row():
580
  prompt_in = gr.Textbox(label="Prompt", placeholder="A corgi running on the grassland on the grassland.", scale = 3)
581
+ target_indices = gr.Textbox(label="Target Indices (1 for the first word, necessary!)", placeholder="1,2", scale = 1)
582
 
583
  with gr.Row():
584
  radio_mode = gr.Radio(label='Trajectory Mode', choices = ['demo', 'diy', 'ori'], scale = 1)