Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
import numpy as np
|
4 |
-
from transformers import pipeline,
|
5 |
from motif_tagging import detect_motifs
|
6 |
import re
|
7 |
import matplotlib.pyplot as plt
|
@@ -44,8 +44,8 @@ sst_pipeline = pipeline("sentiment-analysis", model="distilbert-base-uncased-fin
|
|
44 |
|
45 |
# --- Abuse Model ---
|
46 |
model_name = "SamanthaStorm/tether-multilabel-v1"
|
47 |
-
model =
|
48 |
-
tokenizer =
|
49 |
|
50 |
LABELS = [
|
51 |
"blame shifting", "contradictory statements", "control", "dismissiveness",
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
import numpy as np
|
4 |
+
from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer
|
5 |
from motif_tagging import detect_motifs
|
6 |
import re
|
7 |
import matplotlib.pyplot as plt
|
|
|
44 |
|
45 |
# --- Abuse Model ---
|
46 |
model_name = "SamanthaStorm/tether-multilabel-v1"
|
47 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
48 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
49 |
|
50 |
LABELS = [
|
51 |
"blame shifting", "contradictory statements", "control", "dismissiveness",
|