Spaces:
Running
on
A10G
Running
on
A10G
rynmurdock
commited on
Commit
•
846dcd1
1
Parent(s):
8266839
Update app.py
Browse files
app.py
CHANGED
@@ -58,13 +58,13 @@ def next_image():
|
|
58 |
print(prompt)
|
59 |
|
60 |
image, pooled_embeds = replicate.run(
|
61 |
-
"rynmurdock/zahir:
|
62 |
input={"prompt": prompt,}
|
63 |
)
|
64 |
response = requests.get(url)
|
65 |
image = Image.open(BytesIO(response.content))
|
66 |
|
67 |
-
embs.append(
|
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:
|
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 =
|
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,])
|