SamanthaStorm commited on
Commit
a9d4250
·
verified ·
1 Parent(s): d6e219c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,13 +1,15 @@
1
  import gradio as gr
2
  import torch
3
- from transformers import AutoTokenizer, AutoModelForSequenceClassification
4
  import numpy as np
5
  import tempfile
6
 
7
- # Load your updated model and tokenizer from Hugging Face
8
  model_name = "SamanthaStorm/abuse-pattern-detector-v2"
9
- model = AutoModelForSequenceClassification.from_pretrained(model_name, force_download=True)
10
- tokenizer = AutoTokenizer.from_pretrained(model_name, force_download=True)
 
 
11
 
12
  # Our model outputs 17 labels:
13
  # - First 14 are abuse pattern categories
 
1
  import gradio as gr
2
  import torch
3
+ from transformers import RobertaForSequenceClassification, RobertaTokenizer
4
  import numpy as np
5
  import tempfile
6
 
7
+ # Load model and tokenizer
8
  model_name = "SamanthaStorm/abuse-pattern-detector-v2"
9
+ model = RobertaForSequenceClassification.from_pretrained(model_name)
10
+ tokenizer = RobertaTokenizer.from_pretrained(model_name)
11
+
12
+ TOTAL_LABELS = 17
13
 
14
  # Our model outputs 17 labels:
15
  # - First 14 are abuse pattern categories