KoichiYasuoka
commited on
Commit
•
d4f3736
1
Parent(s):
c8b64c4
cached_file <- hf_bucket_url
Browse files
README.md
CHANGED
@@ -48,11 +48,11 @@ class TransformersUD(object):
|
|
48 |
if os.path.isdir(bert):
|
49 |
d,t=x(os.path.join(bert,"deprel")),x(os.path.join(bert,"tagger"))
|
50 |
else:
|
51 |
-
from transformers.
|
52 |
-
c=AutoConfig.from_pretrained(
|
53 |
-
d=x(
|
54 |
-
s=AutoConfig.from_pretrained(
|
55 |
-
t=x(
|
56 |
self.deprel=TokenClassificationPipeline(model=d,tokenizer=self.tokenizer,
|
57 |
aggregation_strategy="simple")
|
58 |
self.tagger=TokenClassificationPipeline(model=t,tokenizer=self.tokenizer)
|
|
|
48 |
if os.path.isdir(bert):
|
49 |
d,t=x(os.path.join(bert,"deprel")),x(os.path.join(bert,"tagger"))
|
50 |
else:
|
51 |
+
from transformers.utils import cached_file
|
52 |
+
c=AutoConfig.from_pretrained(cached_file(bert,"deprel/config.json"))
|
53 |
+
d=x(cached_file(bert,"deprel/pytorch_model.bin"),config=c)
|
54 |
+
s=AutoConfig.from_pretrained(cached_file(bert,"tagger/config.json"))
|
55 |
+
t=x(cached_file(bert,"tagger/pytorch_model.bin"),config=s)
|
56 |
self.deprel=TokenClassificationPipeline(model=d,tokenizer=self.tokenizer,
|
57 |
aggregation_strategy="simple")
|
58 |
self.tagger=TokenClassificationPipeline(model=t,tokenizer=self.tokenizer)
|