Update app.py
Browse files
app.py
CHANGED
|
@@ -3,9 +3,16 @@ import gradio as gr
|
|
| 3 |
def greet(name):
|
| 4 |
return "Hello " + name + "!!"
|
| 5 |
|
| 6 |
-
gr.load("models/fathyshalaby/emailclassifier").launch()
|
| 7 |
|
|
|
|
|
|
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
|
|
|
|
|
|
|
| 10 |
#iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 11 |
#iface.launch()
|
|
|
|
| 3 |
def greet(name):
|
| 4 |
return "Hello " + name + "!!"
|
| 5 |
|
| 6 |
+
#gr.load("models/fathyshalaby/emailclassifier").launch()
|
| 7 |
|
| 8 |
+
# Use a pipeline as a high-level helper
|
| 9 |
+
from transformers import pipeline
|
| 10 |
|
| 11 |
+
pipe = pipeline("text-classification", model="fathyshalaby/emailclassifier")
|
| 12 |
+
# Load model directly
|
| 13 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 14 |
|
| 15 |
+
tokenizer = AutoTokenizer.from_pretrained("fathyshalaby/emailclassifier")
|
| 16 |
+
model = AutoModelForSequenceClassification.from_pretrained("fathyshalaby/emailclassifier")
|
| 17 |
#iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 18 |
#iface.launch()
|