Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
Β·
58dd1d1
1
Parent(s):
fbeb238
Update app.py
Browse files
app.py
CHANGED
|
@@ -170,8 +170,8 @@ def resize_image(image, out_size):
|
|
| 170 |
|
| 171 |
model_name = "vqgan_imagenet_f16_16384"
|
| 172 |
images_interval = 50
|
| 173 |
-
width =
|
| 174 |
-
height =
|
| 175 |
init_image = ""
|
| 176 |
seed = 42
|
| 177 |
args = argparse.Namespace(
|
|
@@ -183,7 +183,7 @@ args = argparse.Namespace(
|
|
| 183 |
clip_model='ViT-B/32',
|
| 184 |
vqgan_config=f'{model_name}.yaml',
|
| 185 |
vqgan_checkpoint=f'{model_name}.ckpt',
|
| 186 |
-
step_size=0.
|
| 187 |
cutn=4,
|
| 188 |
cut_pow=1.,
|
| 189 |
display_freq=images_interval,
|
|
@@ -197,7 +197,7 @@ perceptor = clip.load(args.clip_model, jit=False)[0].eval().requires_grad_(False
|
|
| 197 |
def inference(text):
|
| 198 |
texts = text
|
| 199 |
target_images = ""
|
| 200 |
-
max_iterations =
|
| 201 |
model_names={"vqgan_imagenet_f16_16384": 'ImageNet 16384',"vqgan_imagenet_f16_1024":"ImageNet 1024", 'vqgan_openimages_f16_8192':'OpenImages 8912',
|
| 202 |
"wikiart_1024":"WikiArt 1024", "wikiart_16384":"WikiArt 16384", "coco":"COCO-Stuff", "faceshq":"FacesHQ", "sflckr":"S-FLCKR"}
|
| 203 |
name_model = model_names[model_name]
|
|
@@ -346,7 +346,7 @@ def load_image( infilename ) :
|
|
| 346 |
def throttled_inference(text):
|
| 347 |
global inferences_running
|
| 348 |
current = inferences_running
|
| 349 |
-
if current >=
|
| 350 |
print(f"Rejected inference when we already had {current} running")
|
| 351 |
return load_image("./gpu.jpg")
|
| 352 |
|
|
|
|
| 170 |
|
| 171 |
model_name = "vqgan_imagenet_f16_16384"
|
| 172 |
images_interval = 50
|
| 173 |
+
width = 350
|
| 174 |
+
height = 350
|
| 175 |
init_image = ""
|
| 176 |
seed = 42
|
| 177 |
args = argparse.Namespace(
|
|
|
|
| 183 |
clip_model='ViT-B/32',
|
| 184 |
vqgan_config=f'{model_name}.yaml',
|
| 185 |
vqgan_checkpoint=f'{model_name}.ckpt',
|
| 186 |
+
step_size=0.12,
|
| 187 |
cutn=4,
|
| 188 |
cut_pow=1.,
|
| 189 |
display_freq=images_interval,
|
|
|
|
| 197 |
def inference(text):
|
| 198 |
texts = text
|
| 199 |
target_images = ""
|
| 200 |
+
max_iterations = 100
|
| 201 |
model_names={"vqgan_imagenet_f16_16384": 'ImageNet 16384',"vqgan_imagenet_f16_1024":"ImageNet 1024", 'vqgan_openimages_f16_8192':'OpenImages 8912',
|
| 202 |
"wikiart_1024":"WikiArt 1024", "wikiart_16384":"WikiArt 16384", "coco":"COCO-Stuff", "faceshq":"FacesHQ", "sflckr":"S-FLCKR"}
|
| 203 |
name_model = model_names[model_name]
|
|
|
|
| 346 |
def throttled_inference(text):
|
| 347 |
global inferences_running
|
| 348 |
current = inferences_running
|
| 349 |
+
if current >= 1:
|
| 350 |
print(f"Rejected inference when we already had {current} running")
|
| 351 |
return load_image("./gpu.jpg")
|
| 352 |
|