# Vicuna-7B Scam Detector A fine-tuned version of Vicuna-7B for detecting scams in Thai text. ## Model Details - Base Model: [lmsys/vicuna-7b-v1.5](https://huggingface.co/lmsys/vicuna-7b-v1.5) - Fine-tuned Model: [ShinyaJ/vicuna-7b-scam-detector](https://huggingface.co/ShinyaJ/vicuna-7b-scam-detector) - Task: Binary Classification (Scam / General) - Language: Thai ## Installation Install required packages: ```bash pip install transformers peft torch bitsandbytes ``` ## Usage To use the model for scam detection: 1. Import necessary libraries: ```python import torch from transformers import LlamaTokenizer, LlamaForSequenceClassification from peft import PeftModel, PeftConfig ``` 2. Load the model and tokenizer: ```python 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) ``` 3. Define the prediction function: ```python def predict_scam(texts, model, tokenizer): . . . return ["scam" if pred == 1 else "general" for pred in predicted_classes] ``` 4. Use the model to predict: ```python text = "Your text here" prediction = predict_scam(text, model_scam, tokenizer) print(prediction) ``` ## License Please refer to the license of the base Vicuna-7B model.