LysandreJik commited on
Commit
927b9ac
1 Parent(s): 9c13c58

Update text_to_image.py

Browse files
Files changed (1) hide show
  1. text_to_image.py +1 -4
text_to_image.py CHANGED
@@ -2,8 +2,7 @@ from transformers.tools.base import Tool, get_default_device
2
  from transformers.utils import is_accelerate_available, is_diffusers_available
3
  import torch
4
 
5
- if is_diffusers_available():
6
- from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
7
 
8
 
9
  TEXT_TO_IMAGE_DESCRIPTION = (
@@ -21,8 +20,6 @@ class TextToImageTool(Tool):
21
  def __init__(self, device=None, **hub_kwargs) -> None:
22
  if not is_accelerate_available():
23
  raise ImportError("Accelerate should be installed in order to use tools.")
24
- if not is_diffusers_available():
25
- raise ImportError("Diffusers should be installed in order to use the StableDiffusionTool.")
26
 
27
  super().__init__()
28
 
 
2
  from transformers.utils import is_accelerate_available, is_diffusers_available
3
  import torch
4
 
5
+ from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
 
6
 
7
 
8
  TEXT_TO_IMAGE_DESCRIPTION = (
 
20
  def __init__(self, device=None, **hub_kwargs) -> None:
21
  if not is_accelerate_available():
22
  raise ImportError("Accelerate should be installed in order to use tools.")
 
 
23
 
24
  super().__init__()
25