Spaces:
Runtime error
Runtime error
Update image_upscaling.py
Browse files- image_upscaling.py +2 -9
image_upscaling.py
CHANGED
@@ -3,14 +3,9 @@ import numpy as np
|
|
3 |
import torch
|
4 |
|
5 |
from transformers.tools.base import Tool, get_default_device
|
6 |
-
from transformers.utils import
|
7 |
-
is_accelerate_available,
|
8 |
-
is_diffusers_available,
|
9 |
-
)
|
10 |
-
|
11 |
|
12 |
-
|
13 |
-
from diffusers import DiffusionPipeline
|
14 |
|
15 |
|
16 |
IMAGE_UPSCALING_DESCRIPTION = (
|
@@ -29,8 +24,6 @@ class ImageUpscalingTool(Tool):
|
|
29 |
def __init__(self, device=None, controlnet=None, stable_diffusion=None, **hub_kwargs) -> None:
|
30 |
if not is_accelerate_available():
|
31 |
raise ImportError("Accelerate should be installed in order to use tools.")
|
32 |
-
if not is_diffusers_available():
|
33 |
-
raise ImportError("Diffusers should be installed in order to use the StableDiffusionTool.")
|
34 |
|
35 |
super().__init__()
|
36 |
|
|
|
3 |
import torch
|
4 |
|
5 |
from transformers.tools.base import Tool, get_default_device
|
6 |
+
from transformers.utils import is_accelerate_available
|
|
|
|
|
|
|
|
|
7 |
|
8 |
+
from diffusers import DiffusionPipeline
|
|
|
9 |
|
10 |
|
11 |
IMAGE_UPSCALING_DESCRIPTION = (
|
|
|
24 |
def __init__(self, device=None, controlnet=None, stable_diffusion=None, **hub_kwargs) -> None:
|
25 |
if not is_accelerate_available():
|
26 |
raise ImportError("Accelerate should be installed in order to use tools.")
|
|
|
|
|
27 |
|
28 |
super().__init__()
|
29 |
|