Skip to content

Commit 5fb50f1

Browse files
committed
test dependency
1 parent 47498fb commit 5fb50f1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/diffusers/utils/remote_utils.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,18 @@
44
from typing import List, Literal, Optional, Union, cast
55

66
import requests
7-
import torch
7+
8+
from .import_utils import is_safetensors_available, is_torch_available
9+
10+
11+
if is_torch_available():
12+
import torch
13+
814
from PIL import Image
9-
from safetensors.torch import _tobytes
15+
16+
17+
if is_safetensors_available():
18+
from safetensors.torch import _tobytes
1019

1120
from ..image_processor import VaeImageProcessor
1221
from ..video_processor import VideoProcessor

0 commit comments

Comments
 (0)