philipp-zettl commited on
Commit
12c460c
·
verified ·
1 Parent(s): 4706395

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import AutoTokenizer
3
+ from model import MultiHeadClassification
4
+
5
+
6
+ model = MultiHeadClassification.from_pretrained('philipp-zettl/multi-head-sequence-classification-model')
7
+ tokenizer = AutoTokenizer.from_pretrained('BAAI/bge-m3')
8
+
9
+ def generate(prompt):
10
+ inputs = tokenizer([prompt])
11
+ return model(**inputs)
12
+
13
+
14
+ gr.Interface(
15
+ generate,
16
+ inputs="text",
17
+ ouputs="label"
18
+ )