Skip to content
Snippets Groups Projects
Commit 87022d9f authored by Alice Brenon's avatar Alice Brenon
Browse files

Improving BERT's init message a bit

parent d37fb822
No related branches found
No related tags found
No related merge requests found
......@@ -5,10 +5,12 @@ class BERT:
model_name = 'bert-base-multilingual-cased'
def __init__(self, path):
print('Loading BERT tools…')
self.tokenizer = BertTokenizer.from_pretrained(BERT.model_name)
print('✔️ tokenizer')
self.device = get_device()
print('Loading BERT tools')
print(' - tokenizer', end='')
self.tokenizer = BertTokenizer.from_pretrained(BERT.model_name)
print('\r✔️ tokenizer')
print(' - classifier', end='')
bert = BertForSequenceClassification.from_pretrained(path)
self.model = bert.to(self.device.type)
print('✔️ classifier')
print('\r✔️ classifier')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment