bugfix tokenizer
Browse files
app.py
CHANGED
@@ -1,11 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import pipeline
|
|
|
3 |
|
4 |
# Specify the name of the model
|
5 |
model_name = 'ehri-ner/xlm-roberta-large-ehri-ner-all'
|
6 |
|
7 |
# Load the model from Hugging Face
|
8 |
ner_model = pipeline('ner', model=model_name)
|
|
|
|
|
9 |
|
10 |
def predict(text):
|
11 |
# Tokenize the text
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline, AutoTokenizer
|
3 |
+
|
4 |
|
5 |
# Specify the name of the model
|
6 |
model_name = 'ehri-ner/xlm-roberta-large-ehri-ner-all'
|
7 |
|
8 |
# Load the model from Hugging Face
|
9 |
ner_model = pipeline('ner', model=model_name)
|
10 |
+
# Load the tokenizer
|
11 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
12 |
|
13 |
def predict(text):
|
14 |
# Tokenize the text
|