Text Generation
Transformers
Safetensors
llama
Generated from Trainer
trl
minillm
opd
kanana
conversational
text-generation-inference
Instructions to use Riasok/kaana-if-opd with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Riasok/kaana-if-opd with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Riasok/kaana-if-opd") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Riasok/kaana-if-opd") model = AutoModelForCausalLM.from_pretrained("Riasok/kaana-if-opd") 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 Riasok/kaana-if-opd with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Riasok/kaana-if-opd" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Riasok/kaana-if-opd", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Riasok/kaana-if-opd
- SGLang
How to use Riasok/kaana-if-opd 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 "Riasok/kaana-if-opd" \ --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": "Riasok/kaana-if-opd", "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 "Riasok/kaana-if-opd" \ --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": "Riasok/kaana-if-opd", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Riasok/kaana-if-opd with Docker Model Runner:
docker model run hf.co/Riasok/kaana-if-opd
kaana-if-opd
This is an open text-generation model fine-tuned from gyubinc/sft with OPD/TRL.
Training
- Student/base model:
gyubinc/sft - Teacher model:
gyubinc/autoif - Dataset:
gyubinc/IF - Method: OPD / MiniLLM-style distillation (
distill_mode=tml) - Precision: bfloat16
- Training checkpoint:
checkpoint-50 - Max planned steps: 100
- Saved global step: 50
- Effective batch size: 128
- Learning rate: 1e-6
- Max prompt length: 1024
- Max completion length: 2048
The source run was interrupted after step 62, and the latest complete saved Hugging Face checkpoint available locally was step 50. This repository contains only inference artifacts and excludes DeepSpeed optimizer state, RNG state, and trainer-resume files.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "riasok/kaana-if-opd"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
prompt = "Write a concise answer: What is instruction following?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Framework Versions
- TRL: 0.26.0
- Transformers: 4.57.1
- PyTorch: 2.8.0
- Datasets: 3.6.0
- Tokenizers: 0.22.2
- Downloads last month
- 1
Model tree for Riasok/kaana-if-opd
Base model
gyubinc/sft