abdulmatinomotoso commited on
Commit
5a85444
1 Parent(s): 42a117e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -2,8 +2,9 @@ from transformers import AutoTokenizer, AutoModelForTokenClassification
2
  from transformers import pipeline
3
  import gradio as gr
4
 
5
- tokenizer = AutoTokenizer.from_pretrained("valurank/bert-base-NER")
6
- model = AutoModelForTokenClassification.from_pretrained("valurank/bert-base-NER")
 
7
  nlp = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="simple")
8
 
9
  def rename_group(output_list):
 
2
  from transformers import pipeline
3
  import gradio as gr
4
 
5
+ model_name = "valurank/bert-base-NER"
6
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
7
+ model = AutoModelForTokenClassification.from_pretrained(model_name)
8
  nlp = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="simple")
9
 
10
  def rename_group(output_list):