Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,15 @@
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
|
4 |
-
#
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
# Function to process the input text and return the predicted label
|
8 |
def predict(text):
|
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
|
4 |
+
# Use a pipeline as a high-level helper
|
5 |
+
|
6 |
+
pipe = pipeline("text-classification", model="ZachBeesley/Spam-Detector")
|
7 |
+
|
8 |
+
# Load model directly
|
9 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
10 |
+
|
11 |
+
tokenizer = AutoTokenizer.from_pretrained("ZachBeesley/Spam-Detector")
|
12 |
+
model = AutoModelForSequenceClassification.from_pretrained("ZachBeesley/Spam-Detector")
|
13 |
|
14 |
# Function to process the input text and return the predicted label
|
15 |
def predict(text):
|