Instructions to use Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1") model = AutoModelForCausalLM.from_pretrained("Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1
- SGLang
How to use Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1 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 "Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1" \ --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": "Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1", "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 "Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1" \ --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": "Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1 with Docker Model Runner:
docker model run hf.co/Saxo/yunsung-llama-2-koen-13b-linkbricks-sft-basic-v1
- Model Card for Model ID
- Configuration including BitsandBytes
- learning_rate = 2e-4
num_epochs = 5
batch_size = 4
block_size = 2048
trainer = "sft"
warmup_ratio = 0.1
weight_decay = 0.01
gradient_accumulation = 4
mixed_precision = "fp16"
peft = True
quantization = "int4"
lora_r = 64
lora_alpha = 16
lora_dropout = 0.1
model_max_length = 2048
- Dataset Format
- Configuration including BitsandBytes
Model Card for Model ID
AI 와 빅데이터 분석 전문 기업인 Linkbricks의 데이터사이언티스트인 지윤성 박사(Saxo)가 beomi/llama-2-koen-13b 베이스모델을 GCP상의 A100-40G 4개를 통해 SFT 훈련을 한(2048 Tokens) 인스트럭션 모델. Accelerate, Deepspeed Zero-3 라이브러리를 사용했으며 Flash Attention 은 Disable 로 설정
Dr. Yunsung Ji (Saxo), a data scientist at Linkbricks, a company specializing in AI and big data analytics, trained the beomi/llama-2-koen-13b base model on 4 A100-40Gs on GCP for 4 hours of instructional training (2048 Tokens). Accelerate, Deepspeed Zero-3 libraries were used.
www.linkbricks.com, www.linkbricks.vc
Configuration including BitsandBytes
learning_rate = 2e-4 num_epochs = 5 batch_size = 4 block_size = 2048 trainer = "sft" warmup_ratio = 0.1 weight_decay = 0.01 gradient_accumulation = 4 mixed_precision = "fp16" peft = True quantization = "int4" lora_r = 64 lora_alpha = 16 lora_dropout = 0.1 model_max_length = 2048
Dataset Format
Alpaca Format Prompt Text
- Downloads last month
- 5