Spaces:
Runtime error
Runtime error
Move pipeline to CUDA in ZeroGPU function
Browse files
app.py
CHANGED
@@ -52,7 +52,7 @@ def generate(
|
|
52 |
)
|
53 |
|
54 |
logger.debug(f"Loading pipeline: {dict(model=model)}")
|
55 |
-
pipe = pipeline_type.from_pretrained(model)
|
56 |
|
57 |
logger.debug(f"Generating image: {dict(prompt=prompt)}")
|
58 |
additional_args = (
|
@@ -62,7 +62,7 @@ def generate(
|
|
62 |
gpu_runner = gpu_3min if model == "timbrooks/instruct-pix2pix" else gpu
|
63 |
|
64 |
images = gpu_runner(
|
65 |
-
lambda: pipe(
|
66 |
prompt=prompt,
|
67 |
image=init_image,
|
68 |
callback_on_step_end=progress_callback,
|
|
|
52 |
)
|
53 |
|
54 |
logger.debug(f"Loading pipeline: {dict(model=model)}")
|
55 |
+
pipe = pipeline_type.from_pretrained(model)
|
56 |
|
57 |
logger.debug(f"Generating image: {dict(prompt=prompt)}")
|
58 |
additional_args = (
|
|
|
62 |
gpu_runner = gpu_3min if model == "timbrooks/instruct-pix2pix" else gpu
|
63 |
|
64 |
images = gpu_runner(
|
65 |
+
lambda: pipe.to("cuda")(
|
66 |
prompt=prompt,
|
67 |
image=init_image,
|
68 |
callback_on_step_end=progress_callback,
|