kyujinpy/KoCommercial-NoSSL
Viewer โข Updated โข 175k โข 161
How to use chlee10/T3Q-ko-solar-sft-v1.0 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="chlee10/T3Q-ko-solar-sft-v1.0")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("chlee10/T3Q-ko-solar-sft-v1.0")
model = AutoModelForCausalLM.from_pretrained("chlee10/T3Q-ko-solar-sft-v1.0")
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 chlee10/T3Q-ko-solar-sft-v1.0 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "chlee10/T3Q-ko-solar-sft-v1.0"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "chlee10/T3Q-ko-solar-sft-v1.0",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/chlee10/T3Q-ko-solar-sft-v1.0
How to use chlee10/T3Q-ko-solar-sft-v1.0 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "chlee10/T3Q-ko-solar-sft-v1.0" \
--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": "chlee10/T3Q-ko-solar-sft-v1.0",
"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 "chlee10/T3Q-ko-solar-sft-v1.0" \
--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": "chlee10/T3Q-ko-solar-sft-v1.0",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use chlee10/T3Q-ko-solar-sft-v1.0 with Docker Model Runner:
docker model run hf.co/chlee10/T3Q-ko-solar-sft-v1.0
Update @ 2024.03.19
This model is a SFT fine-tuned version of davidkim205/nox-solar-10.7b-v4
Model Developers Chihoon Lee(chlee10), T3Q
The following hyperparameters were used during training:
# ๋ฐ์ดํฐ์
๊ณผ ํ๋ จ ํ์์ ๊ด๋ จ๋ ํ์ดํผ ํ๋ผ๋ฏธํฐ
batch_size = 16
num_epochs = 1
micro_batch = 1
gradient_accumulation_steps = batch_size // micro_batch
# ํ๋ จ ๋ฐฉ๋ฒ์ ๋ํ ํ์ดํผ ํ๋ผ๋ฏธํฐ
cutoff_len = 4096
lr_scheduler = 'cosine'
warmup_ratio = 0.06 # warmup_steps = 100
learning_rate = 4e-4
optimizer = 'adamw_torch'
weight_decay = 0.01
max_grad_norm = 1.0
# LoRA config(QLoRA)
lora_r = 16
lora_alpha = 16
lora_dropout = 0.05
lora_target_modules = ["gate_proj", "down_proj", "up_proj"]
# Tokenizer์์ ๋์ค๋ input๊ฐ ์ค์ ์ต์
train_on_inputs = False
add_eos_token = False
# NEFTune params
noise_alpha: int = 5