Prathm commited on
Commit
d0f46df
·
1 Parent(s): 5c9ab89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -39,7 +39,7 @@ preprocess = Compose([
39
  ])
40
 
41
  @st.cache_data
42
- def clip_optimized_latent(text, seed, iterations=25, lr=1e-2):
43
  seed = int(seed)
44
  text_input = clip.tokenize([text]).to(device)
45
 
@@ -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, betas=(0.9, 0.999))
52
 
53
  #with torch.no_grad():
54
  # text_features = clip_model.encode_text(text_input)
 
39
  ])
40
 
41
  @st.cache_data
42
+ def clip_optimized_latent(text, seed, iterations=25, lr=0.1):
43
  seed = int(seed)
44
  text_input = clip.tokenize([text]).to(device)
45
 
 
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)