karanzrk's picture
changed model path
2e43611
raw
history blame
833 Bytes
import gradio as gr
from transformers import pipeline
def inference(text):
classifier = pipeline("text-classification", model="karanzrk/bert-IELTS")
output = classifier(text)
return output[0]["label"]
# launcher = gr.Interface(
# fn=inference,
# inputs=gr.Textbox(lines=5, placeholder="Essay here...."),
# outputs="text"
# )
with gr.Blocks() as demo:
gr.Markdown(
"""
# Welcome to our web app demo
Please type your essay in the Input box below, make sure the essay is less than 500 characters!!
"""
)
inputs = gr.Textbox(label="Input Box",lines = 5, placeholder="Essay here....")
button = gr.Button("Grade!")
output = gr.Textbox(label="Output Box")
button.click(fn=inference, inputs=inputs, outputs = output, api_name="Autograde")
demo.launch()