Commit
·
85ae816
1
Parent(s):
2b1bd59
Update files/functions.py
Browse files- files/functions.py +4 -3
files/functions.py
CHANGED
|
@@ -59,9 +59,10 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
| 59 |
|
| 60 |
model_id = "pierreguillou/lilt-xlm-roberta-base-finetuned-with-DocLayNet-base-at-linelevel-ml384"
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
model.
|
|
|
|
| 65 |
|
| 66 |
# get labels
|
| 67 |
id2label = model.config.id2label
|
|
|
|
| 59 |
|
| 60 |
model_id = "pierreguillou/lilt-xlm-roberta-base-finetuned-with-DocLayNet-base-at-linelevel-ml384"
|
| 61 |
|
| 62 |
+
API_TOKEN = "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"
|
| 63 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, use_auth_token=API_TOKEN)
|
| 64 |
+
model = AutoModelForTokenClassification.from_pretrained(model_id, use_auth_token=API_TOKEN);
|
| 65 |
+
model.to(device);;
|
| 66 |
|
| 67 |
# get labels
|
| 68 |
id2label = model.config.id2label
|