menikev commited on
Commit
fdd0b8f
1 Parent(s): b08e79b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,12 +1,14 @@
1
  import streamlit as st
 
2
  from transformers import RobertaTokenizer, RobertaModel
3
- from prediction_sinhala.py import MDFEND # Ensure you import your model correctly
4
 
5
  # Load model and tokenizer
6
  @st.cache(allow_output_mutation=True)
7
  def load_model():
8
- tokenizer = RobertaTokenizer.from_pretrained("prediction_sinhala.py")
9
- model = MDFEND.from_pretrained("prediction_sinhala.py")
 
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()