Downloads · 30 days
0
0% of all-time downloads
ShinyaJ/vicuna-7b-scam-detector
vicuna-7b-scam-detector is a machine learning model from ShinyaJ. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A fine-tuned version of Vicuna-7B for detecting scams in Thai text.
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
5
Public
Repo size
33.6 MB
Likes
0
Public
Click a slice to open those files.
.safetensors33.6 MB · 100%
From the Hugging Face model README
A fine-tuned version of Vicuna-7B for detecting scams in Thai text.
Install required packages:
pip install transformers peft torch bitsandbytes
To use the model for scam detection:
import torch
from transformers import LlamaTokenizer, LlamaForSequenceClassification
from peft import PeftModel, PeftConfig
model_name = "lmsys/vicuna-7b-v1.5"
peft_model_id = "ShinyaJ/vicuna-7b-scam-detector"
tokenizer = LlamaTokenizer.from_pretrained(model_name)
base_model = LlamaForSequenceClassification.from_pretrained(model_name, num_labels=2, load_in_8bit=True, device_map="auto")
peft_config = PeftConfig.from_pretrained(peft_model_id)
model_scam = PeftModel.from_pretrained(base_model, peft_model_id)
def predict_scam(texts, model, tokenizer):
.
.
.
return ["scam" if pred == 1 else "general" for pred in predicted_classes]
text = "Your text here"
prediction = predict_scam(text, model_scam, tokenizer)
print(prediction)
Please refer to the license of the base Vicuna-7B model.