Update app.py
Browse files
app.py
CHANGED
@@ -21,6 +21,8 @@ def load_models():
|
|
21 |
model_checkpoint = BertForTokenClassification.from_pretrained("dexay/Ner2HgF", )
|
22 |
|
23 |
model_re = AutoModelForSequenceClassification.from_pretrained("dexay/reDs3others", )
|
|
|
|
|
24 |
|
25 |
|
26 |
|
@@ -36,9 +38,11 @@ if submit and len(x) != 0:
|
|
36 |
#model.to("cpu")
|
37 |
st.text("Execution is in progress ...")
|
38 |
|
39 |
-
load_models()
|
40 |
-
|
41 |
|
|
|
|
|
|
|
42 |
|
43 |
|
44 |
token_classifier = pipeline("token-classification", tokenizer = tokenizer,model=model_checkpoint, )
|
|
|
21 |
model_checkpoint = BertForTokenClassification.from_pretrained("dexay/Ner2HgF", )
|
22 |
|
23 |
model_re = AutoModelForSequenceClassification.from_pretrained("dexay/reDs3others", )
|
24 |
+
|
25 |
+
return tokenizer , model_checkpoint , model_re
|
26 |
|
27 |
|
28 |
|
|
|
38 |
#model.to("cpu")
|
39 |
st.text("Execution is in progress ...")
|
40 |
|
41 |
+
tmr = load_models()
|
|
|
42 |
|
43 |
+
tokenizer = tmr[0]
|
44 |
+
model_checkpoint = tmr[1]
|
45 |
+
model_re = tmr[2]
|
46 |
|
47 |
|
48 |
token_classifier = pipeline("token-classification", tokenizer = tokenizer,model=model_checkpoint, )
|