Spaces:
Sleeping
Sleeping
sunnychenxiwang
commited on
Commit
•
f606d30
1
Parent(s):
bf18e31
Update pipeline/GroundingDINO/groundingdino/util/get_tokenlizer.py
Browse files
pipeline/GroundingDINO/groundingdino/util/get_tokenlizer.py
CHANGED
@@ -15,15 +15,13 @@ def get_tokenlizer(text_encoder_type):
|
|
15 |
"Unknown type of text_encoder_type: {}".format(type(text_encoder_type))
|
16 |
)
|
17 |
print("final text_encoder_type: {}".format(text_encoder_type))
|
18 |
-
# text_encoder_type
|
19 |
tokenizer = AutoTokenizer.from_pretrained(text_encoder_type)
|
20 |
return tokenizer
|
21 |
|
22 |
|
23 |
def get_pretrained_language_model(text_encoder_type):
|
24 |
if text_encoder_type == "bert-base-uncased" or (os.path.isdir(text_encoder_type) and os.path.exists(text_encoder_type)):
|
25 |
-
|
26 |
-
return BertModel.from_pretrained("/newdisk3/wcx/models--bert-base-uncased/snapshots/1dbc166cf8765166998eff31ade2eb64c8a40076")
|
27 |
if text_encoder_type == "roberta-base":
|
28 |
return RobertaModel.from_pretrained(text_encoder_type)
|
29 |
|
|
|
15 |
"Unknown type of text_encoder_type: {}".format(type(text_encoder_type))
|
16 |
)
|
17 |
print("final text_encoder_type: {}".format(text_encoder_type))
|
|
|
18 |
tokenizer = AutoTokenizer.from_pretrained(text_encoder_type)
|
19 |
return tokenizer
|
20 |
|
21 |
|
22 |
def get_pretrained_language_model(text_encoder_type):
|
23 |
if text_encoder_type == "bert-base-uncased" or (os.path.isdir(text_encoder_type) and os.path.exists(text_encoder_type)):
|
24 |
+
return BertModel.from_pretrained(text_encoder_type)
|
|
|
25 |
if text_encoder_type == "roberta-base":
|
26 |
return RobertaModel.from_pretrained(text_encoder_type)
|
27 |
|