Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,14 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
from transformers import RobertaTokenizer, RobertaModel
|
3 |
-
from prediction_sinhala
|
4 |
|
5 |
# Load model and tokenizer
|
6 |
@st.cache(allow_output_mutation=True)
|
7 |
def load_model():
|
8 |
-
|
9 |
-
|
|
|
10 |
return model, tokenizer
|
11 |
|
12 |
model, tokenizer = load_model()
|
|
|
1 |
import streamlit as st
|
2 |
+
import torch
|
3 |
from transformers import RobertaTokenizer, RobertaModel
|
4 |
+
from prediction_sinhala import MDFEND
|
5 |
|
6 |
# Load model and tokenizer
|
7 |
@st.cache(allow_output_mutation=True)
|
8 |
def load_model():
|
9 |
+
|
10 |
+
tokenizer = RobertaTokenizer.from_pretrained("./prediction_sinhala/")
|
11 |
+
model = MDFEND.from_pretrained("./prediction_sinhala/")
|
12 |
return model, tokenizer
|
13 |
|
14 |
model, tokenizer = load_model()
|