yazied49 commited on
Commit
cced6e5
·
verified ·
1 Parent(s): 729d03c

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +14 -0
  2. requirments.txt +3 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
3
+
4
+ model_name = "yazied49/disabilityy_model_final"
5
+
6
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
7
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
8
+ pipe = pipeline("text-classification", model=model, tokenizer=tokenizer)
9
+
10
+ def classify(text):
11
+ result = pipe(text)[0]
12
+ return f"Category: {result['label']}\nConfidence: {round(result['score'] * 100, 2)}%"
13
+
14
+ gr.Interface(fn=classify, inputs="text", outputs="text", title="Disability Classifier").launch()
requirments.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ transformers
2
+ torch
3
+ gradio