ikoghoemmanuell commited on
Commit
c1da9c3
·
1 Parent(s): 891311d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -4,14 +4,14 @@ import torch
4
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
5
 
6
  # Load the model and tokenizer
7
- model = AutoModelForSequenceClassification.from_pretrained("ikoghoemmanuell/finetuned_fake_news_bert")
8
- tokenizer = AutoTokenizer.from_pretrained("ikoghoemmanuell/finetuned_fake_news_bert")
9
 
10
  # Define the function for detecting fake news
11
  @st.cache_resource
12
  def detect_fake_news(text):
13
  # Load the pipeline.
14
- model = transformers.pipeline("text-classification", model=model, tokenizer=tokenizer)
15
 
16
  # Predict the sentiment.
17
  prediction = pipeline(text)
 
4
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
5
 
6
  # Load the model and tokenizer
7
+ model_name = AutoModelForSequenceClassification.from_pretrained("ikoghoemmanuell/finetuned_fake_news_bert")
8
+ tokenizer_name = AutoTokenizer.from_pretrained("ikoghoemmanuell/finetuned_fake_news_bert")
9
 
10
  # Define the function for detecting fake news
11
  @st.cache_resource
12
  def detect_fake_news(text):
13
  # Load the pipeline.
14
+ model = transformers.pipeline("text-classification", model=model_name, tokenizer=tokenizer_name)
15
 
16
  # Predict the sentiment.
17
  prediction = pipeline(text)