Instructions to use ozoora/kzlbert-3poi with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ozoora/kzlbert-3poi with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ozoora/kzlbert-3poi")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("ozoora/kzlbert-3poi") model = AutoModelForSequenceClassification.from_pretrained("ozoora/kzlbert-3poi", device_map="auto") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Use:
tokenizer = BertTokenizerFast.from_pretrained('ozooora/kzlbert-3poi') model = AutoModelForSequenceClassification.from_pretrained('ozooora/kzlbert-3poi', return_dict=True)
@torch.no_grad() def predict(text): inputs = tokenizer(text, max_length=419, padding=True, truncation=True, return_tensors='pt') outputs = model(**inputs) predicted_probs = torch.nn.functional.softmax(outputs.logits, dim=1) predicted = torch.argmax(predicted_probs, dim=1).item() return predicted, predicted_probs[0].tolist()
- Downloads last month
- 3