crimson78 commited on
Commit
7505f36
·
verified ·
1 Parent(s): af696e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,11 +1,12 @@
1
  import gradio as gr
2
  import torch
3
- from transformers import AutoModelForSequenceClassification, AutoTokenizer
 
4
 
5
  # Load the model and tokenizer from Hugging Face
6
  model_name = "crimson78/spam_classifier" # Replace with your model's actual name
7
- tokenizer = AutoTokenizer.from_pretrained(model_name)
8
- model = AutoModelForSequenceClassification.from_pretrained(model_name)
9
 
10
  # Define label mapping (Assuming 0 = HAM, 1 = SPAM)
11
  LABELS = {0: "HAM", 1: "SPAM"}
 
1
  import gradio as gr
2
  import torch
3
+ # from transformers import AutoModelForSequenceClassification, AutoTokenizer
4
+ from transformers import BertTokenizer, BertForSequenceClassification
5
 
6
  # Load the model and tokenizer from Hugging Face
7
  model_name = "crimson78/spam_classifier" # Replace with your model's actual name
8
+ tokenizer = BertTokenizer.from_pretrained(model_name)
9
+ model = BertForSequenceClassification.from_pretrained(model_name)
10
 
11
  # Define label mapping (Assuming 0 = HAM, 1 = SPAM)
12
  LABELS = {0: "HAM", 1: "SPAM"}