RakanAlsheraiwi commited on
Commit
b39821e
·
verified ·
1 Parent(s): 17a92b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -1,8 +1,15 @@
1
  from transformers import pipeline
2
  import gradio as gr
3
 
4
- # Load the TensorFlow-compatible pipeline
5
- pipe = pipeline("text-classification", model="ZachBeesley/Spam-Detector", framework="tf")
 
 
 
 
 
 
 
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):