jondurbin/airoboros-2.2.1
Viewer • Updated • 42.7k • 339 • 42
How to use aloobun/TinyAiroboros-2.2.1 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="aloobun/TinyAiroboros-2.2.1") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("aloobun/TinyAiroboros-2.2.1")
model = AutoModelForCausalLM.from_pretrained("aloobun/TinyAiroboros-2.2.1")How to use aloobun/TinyAiroboros-2.2.1 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "aloobun/TinyAiroboros-2.2.1"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "aloobun/TinyAiroboros-2.2.1",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/aloobun/TinyAiroboros-2.2.1
How to use aloobun/TinyAiroboros-2.2.1 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "aloobun/TinyAiroboros-2.2.1" \
--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": "aloobun/TinyAiroboros-2.2.1",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "aloobun/TinyAiroboros-2.2.1" \
--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": "aloobun/TinyAiroboros-2.2.1",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use aloobun/TinyAiroboros-2.2.1 with Docker Model Runner:
docker model run hf.co/aloobun/TinyAiroboros-2.2.1
This model is a fine-tuned version of PY007/TinyLlama-1.1B-Chat-v0.3 (finetuned on 15k rows of airoboros-2.2.1 dataset)
| Task |Version| Metric |Value | |Stderr|
|-------------|------:|--------|-----:|---|-----:|
|arc_challenge| 0|acc |0.2671|± |0.0129|
| | |acc_norm|0.2850|± |0.0132|
|arc_easy | 0|acc |0.5673|± |0.0102|
| | |acc_norm|0.5109|± |0.0103|
|boolq | 1|acc |0.6040|± |0.0086|
|hellaswag | 0|acc |0.4155|± |0.0049|
| | |acc_norm|0.5420|± |0.0050|
|openbookqa | 0|acc |0.2200|± |0.0185|
| | |acc_norm|0.3420|± |0.0212|
|piqa | 0|acc |0.7057|± |0.0106|
| | |acc_norm|0.6970|± |0.0107|
|winogrande | 0|acc |0.5714|± |0.0139|
from transformers import AutoTokenizer
import transformers
import torch
model = "aloobun/TinyAiroboros-2.2.1"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
torch_dtype=torch.float16,
device_map="auto",
)
prompt = "Write a short story about a dystopian society."
sequences = pipeline(
f'[INST] {prompt} [/INST]',
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
max_length=1024,
)
for seq in sequences:
print(f"Result: {seq['generated_text']}")