Spaces:
Runtime error
Runtime error
trying compile (may cause motion degredation!) again & smoll maybe rare bug fix
Browse files
app.py
CHANGED
@@ -114,16 +114,23 @@ pipe.unet.fuse_qkv_projections()
|
|
114 |
#pipe.enable_free_init(method="gaussian", use_fast_sampling=True)
|
115 |
|
116 |
pipe.to(device=DEVICE)
|
117 |
-
|
118 |
-
|
119 |
|
120 |
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
#leave_im_emb.detach().to('cpu')
|
128 |
|
129 |
@spaces.GPU(duration=20)
|
@@ -345,7 +352,7 @@ def choose(img, choice, calibrate_prompts, user_id, request: gr.Request):
|
|
345 |
choice = 0
|
346 |
|
347 |
row_mask = [p.split('/')[-1] in img for p in prevs_df['paths'].to_list()]
|
348 |
-
if len(prevs_df.loc[row_mask, 'user:rating']
|
349 |
prevs_df.loc[row_mask, 'user:rating'][0][user_id] = choice
|
350 |
prevs_df.loc[row_mask, 'latest_user_to_rate'] = [user_id]
|
351 |
img, calibrate_prompts = next_image(calibrate_prompts, user_id)
|
|
|
114 |
#pipe.enable_free_init(method="gaussian", use_fast_sampling=True)
|
115 |
|
116 |
pipe.to(device=DEVICE)
|
117 |
+
pipe.unet = torch.compile(pipe.unet)
|
118 |
+
pipe.vae = torch.compile(pipe.vae)
|
119 |
|
120 |
|
121 |
+
im_embs = torch.zeros(1, 1, 1, 1280, device=DEVICE, dtype=dtype)
|
122 |
+
output = pipe(prompt='a person', guidance_scale=0, added_cond_kwargs={}, ip_adapter_image_embeds=[im_embs], num_inference_steps=STEPS)
|
123 |
+
leave_im_emb, _ = pipe.encode_image(
|
124 |
+
output.frames[0][len(output.frames[0])//2], DEVICE, 1, output_hidden_state
|
125 |
+
)
|
126 |
+
assert len(output.frames[0]) == 16
|
127 |
+
|
128 |
+
im_embs = torch.zeros(1, 1, 1, 1280, device=DEVICE, dtype=dtype)
|
129 |
+
output = pipe(prompt='a person', guidance_scale=0, added_cond_kwargs={}, ip_adapter_image_embeds=[im_embs], num_inference_steps=STEPS)
|
130 |
+
leave_im_emb, _ = pipe.encode_image(
|
131 |
+
output.frames[0][len(output.frames[0])//2], DEVICE, 1, output_hidden_state
|
132 |
+
)
|
133 |
+
|
134 |
#leave_im_emb.detach().to('cpu')
|
135 |
|
136 |
@spaces.GPU(duration=20)
|
|
|
352 |
choice = 0
|
353 |
|
354 |
row_mask = [p.split('/')[-1] in img for p in prevs_df['paths'].to_list()]
|
355 |
+
if len(prevs_df.loc[row_mask, 'user:rating']) > 0:
|
356 |
prevs_df.loc[row_mask, 'user:rating'][0][user_id] = choice
|
357 |
prevs_df.loc[row_mask, 'latest_user_to_rate'] = [user_id]
|
358 |
img, calibrate_prompts = next_image(calibrate_prompts, user_id)
|