Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
+
# Manually load the model
|
| 5 |
+
model = pipeline('text-classification', model="Ajay1311/phish")
|
| 6 |
+
|
| 7 |
+
# Define a function for Gradio interface
|
| 8 |
+
def classify(text):
|
| 9 |
+
return model(text)
|
| 10 |
+
|
| 11 |
+
# Create the Gradio interface
|
| 12 |
+
gr.Interface(fn=classify, inputs="text", outputs="json").launch()
|