rynmurdock commited on
Commit
846dcd1
1 Parent(s): 8266839

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -58,13 +58,13 @@ def next_image():
58
  print(prompt)
59
 
60
  image, pooled_embeds = replicate.run(
61
- "rynmurdock/zahir:e64023db020f28b77d407c8954c82530df96679ae7d97e302c7ed9d9e68b851a",
62
  input={"prompt": prompt,}
63
  )
64
  response = requests.get(url)
65
  image = Image.open(BytesIO(response.content))
66
 
67
- embs.append(pickle.load(urlopen(pooled_embeim_embds, 'rb')))
68
  return image
69
  else:
70
  print('######### Roaming #########')
@@ -98,14 +98,14 @@ def next_image():
98
  print(prompt)
99
 
100
  image, im_emb = replicate.run(
101
- "rynmurdock/zahir:e64023db020f28b77d407c8954c82530df96679ae7d97e302c7ed9d9e68b851a",
102
  input={"prompt": prompt, 'im_emb': pickle.dumps(im_emb)}
103
  )
104
  response = requests.get(url)
105
  image = Image.open(BytesIO(response.content))
106
 
107
 
108
- im_emb = pickle.load(urlopen(im_emb, 'rb'))
109
  embs.append(im_emb)
110
 
111
  torch.save(lin_class.coef_, f'./{start_time}.pt')
@@ -166,7 +166,7 @@ with gr.Blocks(css=css) as demo:
166
  [img]
167
  )
168
  with gr.Row():
169
- b4 = gr.Button(value='Start')
170
  b4.click(start,
171
  [b4],
172
  [b1, b2, b3, b4, img,])
 
58
  print(prompt)
59
 
60
  image, pooled_embeds = replicate.run(
61
+ "rynmurdock/zahir:49ebb1916c4baae35884ebfa16b092cf45d086c1913b53f62bb07d575cdbe683",
62
  input={"prompt": prompt,}
63
  )
64
  response = requests.get(url)
65
  image = Image.open(BytesIO(response.content))
66
 
67
+ embs.append(torch.tensor(urlopen(pooled_embeds).read().decode('utf-8').split(', ')))
68
  return image
69
  else:
70
  print('######### Roaming #########')
 
98
  print(prompt)
99
 
100
  image, im_emb = replicate.run(
101
+ "rynmurdock/zahir:49ebb1916c4baae35884ebfa16b092cf45d086c1913b53f62bb07d575cdbe683",
102
  input={"prompt": prompt, 'im_emb': pickle.dumps(im_emb)}
103
  )
104
  response = requests.get(url)
105
  image = Image.open(BytesIO(response.content))
106
 
107
 
108
+ im_emb = torch.tensor(urlopen(im_emb).read().decode('utf-8').split(', '))
109
  embs.append(im_emb)
110
 
111
  torch.save(lin_class.coef_, f'./{start_time}.pt')
 
166
  [img]
167
  )
168
  with gr.Row():
169
+ b4 = gr.Button(value='Start'9bc92ec26fa95fe2ee8e15501ad9085bbb4013b42be9cd2b48c8e5086bc4ae83)
170
  b4.click(start,
171
  [b4],
172
  [b1, b2, b3, b4, img,])