Spaces:
Sleeping
Sleeping
yeshpanovrustem
commited on
Commit
β’
2dd0e89
1
Parent(s):
07d1047
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,13 @@
|
|
1 |
import streamlit as st
|
2 |
-
|
3 |
-
from transformers import pipeline
|
4 |
|
5 |
# use @st.cache decorator to cache model β because it is too large, we do not want to reload it every time
|
6 |
# use allow_output_mutation = True to tell streamlit that model should be treated as immutable object β singleton
|
7 |
@st.cache(allow_output_mutation = True)
|
8 |
|
9 |
# load model and tokenizer
|
10 |
-
tokenizer = AutoTokenizer.from_pretrained("yeshpanovrustem/xlm-roberta-large-ner-kazakh")
|
11 |
-
model = AutoModelForTokenClassification.from_pretrained("yeshpanovrustem/xlm-roberta-large-ner-kazakh")
|
12 |
|
13 |
# # define function for ner
|
14 |
|
|
|
1 |
import streamlit as st
|
2 |
+
import transformers
|
|
|
3 |
|
4 |
# use @st.cache decorator to cache model β because it is too large, we do not want to reload it every time
|
5 |
# use allow_output_mutation = True to tell streamlit that model should be treated as immutable object β singleton
|
6 |
@st.cache(allow_output_mutation = True)
|
7 |
|
8 |
# load model and tokenizer
|
9 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained("yeshpanovrustem/xlm-roberta-large-ner-kazakh")
|
10 |
+
model = transformers.AutoModelForTokenClassification.from_pretrained("yeshpanovrustem/xlm-roberta-large-ner-kazakh")
|
11 |
|
12 |
# # define function for ner
|
13 |
|