Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline | |
| # Load your model from your Hugging Face repo | |
| model = AutoModelForSequenceClassification.from_pretrained("hshkoukani/bolt") | |
| tokenizer = AutoTokenizer.from_pretrained("hshkoukani/bolt") | |
| clf = pipeline("text-classification", model=model, tokenizer=tokenizer) | |
| def classify(text): | |
| result = clf(text)[0] | |
| return f"{result['label']} ({round(result['score'] * 100, 2)}%)" | |
| demo = gr.Interface(fn=classify, inputs="text", outputs="text", title="Bolt Classifier") | |
| demo.launch() |