File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
google/generativeai/vision_models Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change 34
34
from proto .marshal .collections import repeated
35
35
36
36
37
- # pylint: disable=g-import-not-at-top
38
- try :
37
+ # pylint: disable=g-import-not-at-top\
38
+ if typing . TYPE_CHECKING :
39
39
from IPython import display as IPython_display
40
- except ImportError :
41
- IPython_display = None
42
-
43
- try :
44
- from PIL import Image as PIL_Image
45
- except ImportError :
46
- PIL_Image = None
40
+ else :
41
+ try :
42
+ from IPython import display as IPython_display
43
+ except ImportError :
44
+ IPython_display = None
45
+
46
+ if typing .TYPE_CHECKING :
47
+ import PIL .Image as PIL_Image
48
+ else :
49
+ try :
50
+ from PIL import Image as PIL_Image
51
+ except ImportError :
52
+ PIL_Image = None
47
53
48
54
49
55
# This is to get around https://github.com/googleapis/proto-plus-python/issues/488
You can’t perform that action at this time.
0 commit comments