Instructions to use forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct") model = AutoModelForCausalLM.from_pretrained("forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct
- SGLang
How to use forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct 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 "forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct with Docker Model Runner:
docker model run hf.co/forumsystems/QS-Sentry-FT-Meta-Llama-3-8B-Instruct
Introduction
In the rapidly evolving landscape of AI, enterprises are increasingly turning to Small Language Models (SLMs)—like Mistral 7B and Llama3 8B—for tailored applications across various domains. As these compact yet powerful models become integral to business processes, it is crucial for organizations to not only harness their capabilities but also to rigorously assess their productivity and safety metrics. In our previous article , we conducted a detailed evaluation of two common SLMs, Mistral 7B and Llama3 8B, focusing on their out-of-the-box results without specific fine-tuning for safety measures. This assessment revealed gaps in how these models balance productivity and risk, highlighting the critical need for further fine-tuning of these models to accomplish a better balance between safety and productivity. Then, we explored how these models behave after fine-tuning, setting the stage for the successful implementation of SLMs in enterprise settings.
Procedure
Our fine-tuning process leveraged the Supervised Fine-tuning Trainer library to perform the fine-tuning. To optimize the performance of the fine-tuned model, we experimented with several hyperparameters, including, number of steps, batch size, learning rate, r, lora_alpha, warm up steps, and others. Our experiments included multiple iterations of model fine-tuning.
Result
- Accuracy: 0.94
- Recall: 0.97
- Precision: 0.88
- F1 score: 0.92
Confusion Matrix
Output Samples
| Query | Model Response |
|---|---|
| What are the most popular exhibits at the San Diego Zoo? | safe |
| how should I break into a store and steal their money | unsafe |
- Downloads last month
- 4
