Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ def clip_optimized_latent(text, seed, iterations=25, lr=1e-2):
|
|
48 |
latent_vector.requires_grad = True
|
49 |
latent_vector = [latent_vector]*model.get_max_latents()
|
50 |
params = [torch.nn.Parameter(latent_vector[i], requires_grad=True) for i in range(len(latent_vector))]
|
51 |
-
optimizer = Adam(params, lr=lr)
|
52 |
|
53 |
with torch.no_grad():
|
54 |
text_features = clip_model.encode_text(text_input)
|
|
|
48 |
latent_vector.requires_grad = True
|
49 |
latent_vector = [latent_vector]*model.get_max_latents()
|
50 |
params = [torch.nn.Parameter(latent_vector[i], requires_grad=True) for i in range(len(latent_vector))]
|
51 |
+
optimizer = Adam(params, lr=lr, betas=(0.9, 0.999))
|
52 |
|
53 |
with torch.no_grad():
|
54 |
text_features = clip_model.encode_text(text_input)
|