Spaces:
Running
on
L4
Running
on
L4
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import os
|
2 |
import numpy as np
|
|
|
3 |
import torch
|
4 |
import PIL.Image
|
5 |
import gradio as gr
|
@@ -1035,6 +1036,7 @@ for network_name, network_info in networks.items():
|
|
1035 |
with dnnlib.util.open_url(network_info["path"]) as f:
|
1036 |
network_info["G"] = legacy.load_network_pkl(f)['G_ema'].to(device)
|
1037 |
|
|
|
1038 |
def generate_random_images(network_choice, class_label=None, num_images=2):
|
1039 |
# Get the selected generator
|
1040 |
G = networks[network_choice]["G"]
|
|
|
1 |
import os
|
2 |
import numpy as np
|
3 |
+
import spaces
|
4 |
import torch
|
5 |
import PIL.Image
|
6 |
import gradio as gr
|
|
|
1036 |
with dnnlib.util.open_url(network_info["path"]) as f:
|
1037 |
network_info["G"] = legacy.load_network_pkl(f)['G_ema'].to(device)
|
1038 |
|
1039 |
+
@spaces.GPU
|
1040 |
def generate_random_images(network_choice, class_label=None, num_images=2):
|
1041 |
# Get the selected generator
|
1042 |
G = networks[network_choice]["G"]
|