Spaces:
Runtime error
Runtime error
Commit
·
4bb51bf
1
Parent(s):
803ed1c
Update app.py
Browse files
app.py
CHANGED
@@ -125,7 +125,7 @@ perceptor = clip.load('ViT-B/32', jit=False)[0].eval().requires_grad_(False).to(
|
|
125 |
normalize = transforms.Normalize(mean=[0.48145466, 0.4578275, 0.40821073],
|
126 |
std=[0.26862954, 0.26130258, 0.27577711])
|
127 |
cut_size = perceptor.visual.input_resolution
|
128 |
-
cutn=64
|
129 |
cut_pow=1
|
130 |
make_cutouts = MakeCutouts(cut_size, cutn, cut_pow=cut_pow)
|
131 |
|
@@ -257,10 +257,10 @@ def generate(text, n_steps):
|
|
257 |
return np.array(im)
|
258 |
|
259 |
iface = gr.Interface(fn=generate,
|
260 |
-
description = "Attempt at a
|
261 |
inputs=[
|
262 |
gr.inputs.Textbox(label="Text Input"),
|
263 |
-
gr.inputs.Number(default=
|
264 |
],
|
265 |
outputs=[
|
266 |
gr.outputs.Image(type="numpy", label="Output Image")
|
|
|
125 |
normalize = transforms.Normalize(mean=[0.48145466, 0.4578275, 0.40821073],
|
126 |
std=[0.26862954, 0.26130258, 0.27577711])
|
127 |
cut_size = perceptor.visual.input_resolution
|
128 |
+
cutn=8 # 64 but using less to save on CPU
|
129 |
cut_pow=1
|
130 |
make_cutouts = MakeCutouts(cut_size, cutn, cut_pow=cut_pow)
|
131 |
|
|
|
257 |
return np.array(im)
|
258 |
|
259 |
iface = gr.Interface(fn=generate,
|
260 |
+
description = "Attempt at a Gradio demo for https://colab.research.google.com/drive/1dBPXIspuMocqfcJqfjCn_PFeUfr36KGu?usp=sharing, struggles since it's a little slow on CPU",
|
261 |
inputs=[
|
262 |
gr.inputs.Textbox(label="Text Input"),
|
263 |
+
gr.inputs.Number(default=40, label="N Steps")
|
264 |
],
|
265 |
outputs=[
|
266 |
gr.outputs.Image(type="numpy", label="Output Image")
|