File size: 475 Bytes
2765893
e7692af
c635ea8
 
2765893
 
 
 
c635ea8
 
8ef424d
c635ea8
 
 
 
 
2765893
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
import os
from setfit import SetFitModel


def greet(name):
    return "Hello " + name + "!!"

model = SetFitModel.from_pretrained("aalkaswan/java-deprecation-classifier", 
                                    device='cpu', #Use this if you don't have a GPU 
                                    token=os.environ.get('sec_tok'))

def classify(text):
    return model(text)
    
iface = gr.Interface(fn=classify, inputs="text", outputs="text")
iface.launch()