Malaysian LLM2Vec
Collection
Extending Malaysian CausalLM on non-causal masking training, https://arxiv.org/abs/2404.05961 • 5 items • Updated
How to use mesolitica/mnli-malaysian-mistral-191M-MLM-512 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="mesolitica/mnli-malaysian-mistral-191M-MLM-512", trust_remote_code=True) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("mesolitica/mnli-malaysian-mistral-191M-MLM-512", trust_remote_code=True)
model = AutoModelForSequenceClassification.from_pretrained("mesolitica/mnli-malaysian-mistral-191M-MLM-512", trust_remote_code=True, device_map="auto")Original model https://huggingface.co/mesolitica/malaysian-mistral-191M-MLM-512, done by https://github.com/aisyahrzk https://twitter.com/aisyahhhrzk
You must use model from here https://github.com/mesolitica/malaya/blob/master/session/llm2vec/classifier.py
precision recall f1-score support
0 0.84488 0.90914 0.87583 7165
1 0.92182 0.86519 0.89261 8872
accuracy 0.88483 16037
macro avg 0.88335 0.88717 0.88422 16037
weighted avg 0.88744 0.88483 0.88511 16037