Mehdi Cherti commited on
Commit
c7f1d48
1 Parent(s): abdab20

deal with t5 importerror

Browse files
Files changed (1) hide show
  1. encoder.py +9 -2
encoder.py CHANGED
@@ -1,5 +1,12 @@
1
- import t5
2
- import clip_encoder
 
 
 
 
 
 
 
3
 
4
  def build_encoder(name, **kwargs):
5
  if name.startswith("google"):
 
1
+ try:
2
+ import t5
3
+ except ImportError:
4
+ pass
5
+
6
+ try:
7
+ import clip_encoder
8
+ except ImportError:
9
+ pass
10
 
11
  def build_encoder(name, **kwargs):
12
  if name.startswith("google"):