Instructions to use marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification") model = AutoModelForCausalLM.from_pretrained("marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification
- SGLang
How to use marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification with Docker Model Runner:
docker model run hf.co/marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification
Disclaimer:
This model is provided as-is and may be overtrained, leading to potential biases or inaccuracies. Use it at your own discretion and only for personal or non-critical applications. The author is not responsible for any outcomes, damages, or misuse. Always verify results before relying on them.
Model Details
Developed by: Marco Orasch, Andre Salzer
Model Type: Transformer-based Language Model
Language(s): English
Finetuned from model: llama-3.2-3B
Training Epochs: 1
Batch Size: 1
Learning Rate: 2e-4
Optimizer: AdamW
Model Description
This model is fine-tuned for the task of classifying hate speech and offensive language in English text. It leverages the llama-3.2-3B model architecture, refined through a supervised learning approach using a dataset specifically curated for identifying harmful and offensive content. The model can distinguish between hate speech, offensive language, and neutral content, making it suitable for content moderation and safety applications.
Training Procedure
Run Details: https://api.wandb.ai/links/marcoor-universit-t-klagenfurt/oxoxik67
Base Model: llama-3.2-3B
Fine-tuning Framework: PyTorch with Hugging Face Transformers
Tutorial Used: https://www.datacamp.com/tutorial/fine-tuning-llama-3-1
Intended Use
Content moderation on social media platforms
Automated filtering of offensive content in forums and chat applications
Assisting research in online safety and digital well-being
- Downloads last month
- 1
Model tree for marcoorasch/llama-3.2-3B-instruct-hatespeech-offensive-classification
Base model
meta-llama/Llama-3.2-3B-Instruct