Guihss commited on
Commit
160f7dd
·
1 Parent(s): c4f88d2

first commit

Browse files
Files changed (3) hide show
  1. .gitignore +3 -0
  2. app.py +14 -0
  3. requirements.txt +4 -0
.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ flagged
2
+ .idea
3
+ venv
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ reader = pipeline("text-classification", model='Guihss/TypeBERT', trust_remote_code=True,
5
+ revision='main')
6
+
7
+
8
+
9
+ def predict(text):
10
+ return {s['label']: s['score'] for s in reader(text, top_k=None)}
11
+
12
+
13
+ iface = gr.Interface(fn=predict, inputs="text", outputs='label')
14
+ iface.launch()
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ transformers
2
+ torch
3
+ torchvision
4
+ torchaudio