HuggingFaceTB/smoltalk
Viewer • Updated • 2.2M • 30.8k • 428
How to use khulaifi95/Llama-3.1-8B-Reason-Blend-888k with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="khulaifi95/Llama-3.1-8B-Reason-Blend-888k")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("khulaifi95/Llama-3.1-8B-Reason-Blend-888k")
model = AutoModelForCausalLM.from_pretrained("khulaifi95/Llama-3.1-8B-Reason-Blend-888k", device_map="auto")
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]:]))How to use khulaifi95/Llama-3.1-8B-Reason-Blend-888k with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "khulaifi95/Llama-3.1-8B-Reason-Blend-888k"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "khulaifi95/Llama-3.1-8B-Reason-Blend-888k",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/khulaifi95/Llama-3.1-8B-Reason-Blend-888k
How to use khulaifi95/Llama-3.1-8B-Reason-Blend-888k with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "khulaifi95/Llama-3.1-8B-Reason-Blend-888k" \
--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": "khulaifi95/Llama-3.1-8B-Reason-Blend-888k",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "khulaifi95/Llama-3.1-8B-Reason-Blend-888k" \
--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": "khulaifi95/Llama-3.1-8B-Reason-Blend-888k",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use khulaifi95/Llama-3.1-8B-Reason-Blend-888k with Docker Model Runner:
docker model run hf.co/khulaifi95/Llama-3.1-8B-Reason-Blend-888k
This is an experimental model, so it might not perform well for some prompts and may be sensitive to hyper parameters. It is mainly trained to enhance reasoning capabilities.
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | |
| IFEval (0-Shot) | |
| BBH (3-Shot) | |
| MATH Lvl 5 (4-Shot) | |
| GPQA (0-shot) | |
| MuSR (0-shot) | |
| MMLU-PRO (5-shot) |
This model uses ChatML prompt template:
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are Llama Reason Blend, a helpful AI assistant.<|eot_id|>
<|start_header_id|>user<|end_header_id|>
Hello Llama Reason Blend, what can you do for me?<|eot_id|>
<|start_header_id|>assistant<|end_header_id|>
# Use a pipeline as a high-level helper
from transformers import pipeline
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe = pipeline("text-generation", model="khulaifi95/Llama-3.1-8B-Reason-Blend-888k")
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("khulaifi95/Llama-3.1-8B-Reason-Blend-888k")
model = AutoModelForCausalLM.from_pretrained("khulaifi95/Llama-3.1-8B-Reason-Blend-888k")
As with any large language model, users should be aware of potential biases and limitations. We recommend implementing appropriate safeguards and human oversight when deploying this model in production environments.