Commit
·
eaf48db
1
Parent(s):
d345be1
Update files/functions.py
Browse files- files/functions.py +3 -4
files/functions.py
CHANGED
@@ -57,11 +57,10 @@ sep_box = cls_box
|
|
57 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
58 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
59 |
|
60 |
-
model_id = "pierreguillou/lilt-xlm-roberta-base-finetuned-DocLayNet-base_paragraphs_ml512
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
model = AutoModelForTokenClassification.from_pretrained(model_id, use_auth_token=API_TOKEN);
|
65 |
model.to(device);
|
66 |
|
67 |
# get labels
|
|
|
57 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
58 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
59 |
|
60 |
+
model_id = "pierreguillou/lilt-xlm-roberta-base-finetuned-DocLayNet-base_paragraphs_ml512"
|
61 |
|
62 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
63 |
+
model = AutoModelForTokenClassification.from_pretrained(model_id);
|
|
|
64 |
model.to(device);
|
65 |
|
66 |
# get labels
|