Text Generation
Transformers
Safetensors
English
multilingual
apertus
compliant
swiss-ai
fine-tuned
aqua_rat
conversational
4-bit precision
bitsandbytes
Instructions to use safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT") model = AutoModelForCausalLM.from_pretrained("safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT") 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 Settings
- vLLM
How to use safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT
- SGLang
How to use safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT 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 "safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT" \ --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": "safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT", "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 "safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT" \ --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": "safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT with Docker Model Runner:
docker model run hf.co/safouaneelg/Apertus-8B-Instruct-2509-AQUA-RAT-SFT
update model card
Browse files
README.md
CHANGED
|
@@ -31,7 +31,9 @@ Check out the model info here: [Swiss-AI/LLM](https://huggingface.co/collections
|
|
| 31 |
# Finetuned on AQUA-RAT
|
| 32 |
|
| 33 |
This repo contains the fine-tuned version of Apertus on [AQuA-RAT dataset](https://huggingface.co/datasets/deepmind/aqua_rat).
|
|
|
|
| 34 |
The fine-tuning was performed using Unsloth on one GPU (RTX A6000 48 GB) with the following parameters:
|
|
|
|
| 35 |
- per_device_train_batch_size: 8
|
| 36 |
- gradient_accumulation_steps: 4 (effective batch size: 32)
|
| 37 |
- warmup_steps: 10
|
|
@@ -46,7 +48,7 @@ The fine-tuning was performed using Unsloth on one GPU (RTX A6000 48 GB) with th
|
|
| 46 |
- eval_strategy: steps
|
| 47 |
- eval_steps: 150
|
| 48 |
- packing: True
|
| 49 |
-
|
| 50 |
## How to use
|
| 51 |
|
| 52 |
You can run this fine-tuned version using the below instructions:
|
|
|
|
| 31 |
# Finetuned on AQUA-RAT
|
| 32 |
|
| 33 |
This repo contains the fine-tuned version of Apertus on [AQuA-RAT dataset](https://huggingface.co/datasets/deepmind/aqua_rat).
|
| 34 |
+
|
| 35 |
The fine-tuning was performed using Unsloth on one GPU (RTX A6000 48 GB) with the following parameters:
|
| 36 |
+
|
| 37 |
- per_device_train_batch_size: 8
|
| 38 |
- gradient_accumulation_steps: 4 (effective batch size: 32)
|
| 39 |
- warmup_steps: 10
|
|
|
|
| 48 |
- eval_strategy: steps
|
| 49 |
- eval_steps: 150
|
| 50 |
- packing: True
|
| 51 |
+
|
| 52 |
## How to use
|
| 53 |
|
| 54 |
You can run this fine-tuned version using the below instructions:
|