pierreguillou
commited on
Commit
•
5c83197
1
Parent(s):
e19b360
Update app.py
Browse files
app.py
CHANGED
@@ -72,6 +72,11 @@ from transformers import AutoTokenizer
|
|
72 |
tokenizer_id = "xlm-roberta-base"
|
73 |
tokenizer = AutoTokenizer.from_pretrained(tokenizer_id)
|
74 |
|
|
|
|
|
|
|
|
|
|
|
75 |
# APP outputs
|
76 |
def app_outputs(uploaded_pdf):
|
77 |
filename, msg, images = pdf_to_images(uploaded_pdf)
|
|
|
72 |
tokenizer_id = "xlm-roberta-base"
|
73 |
tokenizer = AutoTokenizer.from_pretrained(tokenizer_id)
|
74 |
|
75 |
+
# get labels
|
76 |
+
id2label = model.config.id2label
|
77 |
+
label2id = model.config.label2id
|
78 |
+
num_labels = len(id2label)
|
79 |
+
|
80 |
# APP outputs
|
81 |
def app_outputs(uploaded_pdf):
|
82 |
filename, msg, images = pdf_to_images(uploaded_pdf)
|