Kingston Yip commited on
Commit
743c8db
β€’
1 Parent(s): 611cacb

removed cache

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -27,7 +27,7 @@ def predict_cyberbullying_probability(sentence, tokenizer, model):
27
 
28
  # @st.cache
29
  def perform_cyberbullying_analysis(tweet):
30
- with st.spinner(text="loading model..."):
31
 
32
  model = AutoModelForSequenceClassification.from_pretrained('kingsotn/finetuned_cyberbullying')
33
  tokenizer = DistilBertTokenizerFast.from_pretrained('distilbert-base-uncased')
@@ -81,11 +81,10 @@ with st.form("my_form"):
81
  model_name = st.selectbox("Enter a text and select a pre-trained model to get the sentiment analysis", ["kingsotn/finetuned_cyberbullying", "distilbert-base-uncased-finetuned-sst-2-english", "finiteautomata/bertweet-base-sentiment-analysis", "distilbert-base-uncased"])
82
 
83
  if model_name == "kingsotn/finetuned_cyberbullying":
84
- if model_name == "kingsotn/finetuned_cyberbullying":
85
- default = "I'm nice at ping pong"
86
- tweet = st.text_area(label="Enter Text:",value=default)
87
- submitted = st.form_submit_button("Analyze textbox")
88
- random = st.form_submit_button("Analyze a random 😈😈😈 tweet")
89
 
90
  if random:
91
  tweet = comments.comments[randint(0, 354)]
 
27
 
28
  # @st.cache
29
  def perform_cyberbullying_analysis(tweet):
30
+ with st.spinner(text="loading model, wait until spinner ends..."):
31
 
32
  model = AutoModelForSequenceClassification.from_pretrained('kingsotn/finetuned_cyberbullying')
33
  tokenizer = DistilBertTokenizerFast.from_pretrained('distilbert-base-uncased')
 
81
  model_name = st.selectbox("Enter a text and select a pre-trained model to get the sentiment analysis", ["kingsotn/finetuned_cyberbullying", "distilbert-base-uncased-finetuned-sst-2-english", "finiteautomata/bertweet-base-sentiment-analysis", "distilbert-base-uncased"])
82
 
83
  if model_name == "kingsotn/finetuned_cyberbullying":
84
+ default = "I'm nice at ping pong"
85
+ tweet = st.text_area(label="Enter Text:",value=default)
86
+ submitted = st.form_submit_button("Analyze textbox")
87
+ random = st.form_submit_button("Analyze a random 😈😈😈 tweet")
 
88
 
89
  if random:
90
  tweet = comments.comments[randint(0, 354)]