migtissera/Tess-v1.5
Viewer • Updated • 126k • 36 • 59
How to use trollek/danube2-1.8b-Tess-v1.5 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="trollek/danube2-1.8b-Tess-v1.5")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("trollek/danube2-1.8b-Tess-v1.5")
model = AutoModelForCausalLM.from_pretrained("trollek/danube2-1.8b-Tess-v1.5", 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 trollek/danube2-1.8b-Tess-v1.5 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "trollek/danube2-1.8b-Tess-v1.5"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "trollek/danube2-1.8b-Tess-v1.5",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/trollek/danube2-1.8b-Tess-v1.5
How to use trollek/danube2-1.8b-Tess-v1.5 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "trollek/danube2-1.8b-Tess-v1.5" \
--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": "trollek/danube2-1.8b-Tess-v1.5",
"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 "trollek/danube2-1.8b-Tess-v1.5" \
--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": "trollek/danube2-1.8b-Tess-v1.5",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use trollek/danube2-1.8b-Tess-v1.5 with Docker Model Runner:
docker model run hf.co/trollek/danube2-1.8b-Tess-v1.5
This model was first fine-tuned with BAdam on migtissera/Tess-v1.5 using LLama-Factory.
Thanks to mradermacher for this!
<|im_start|>system
{{system}}<|im_end|>
<|im_start|>user
{{instruction}}<|im_end|>
<|im_start|>assistant
{{response}}<|im_end|>
### model
model_name_or_path: danube2-base-chatml
### method
stage: sft
do_train: true
finetuning_type: full
use_badam: true
badam_switch_mode: ascending
badam_switch_interval: 50
badam_verbose: 1
badam_start_block: 6
seed: 720
### dataset
dataset: tess15
template: hermes_chatml
cutoff_len: 8192
overwrite_cache: false
preprocessing_num_workers: 12
### output
output_dir: tess15-chatml-badam
logging_steps: 5
save_steps: 1
save_strategy: epoch
plot_loss: true
overwrite_output_dir: false
### train
per_device_train_batch_size: 2
gradient_accumulation_steps: 4
learning_rate: 0.00001
num_train_epochs: 1
lr_scheduler_type: constant_with_warmup
warmup_ratio: 0.01
bf16: true
flash_attn: fa2
### eval
val_size: 0.01
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 1000
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.8017 | 0.0643 | 1000 | 0.6820 |
| 0.6167 | 0.1287 | 2000 | 0.6610 |
| 0.6161 | 0.1930 | 3000 | 0.6496 |
| 0.6322 | 0.2574 | 4000 | 0.6423 |
| 0.5127 | 0.3217 | 5000 | 0.6366 |
| 0.61 | 0.3860 | 6000 | 0.6312 |
| 0.6758 | 0.4504 | 7000 | 0.6266 |
| 0.5901 | 0.5147 | 8000 | 0.6215 |
| 0.5163 | 0.5791 | 9000 | 0.6197 |
| 0.6043 | 0.6434 | 10000 | 0.6175 |
| 0.5056 | 0.7077 | 11000 | 0.6153 |
| 0.5772 | 0.7721 | 12000 | 0.6126 |
| 0.6692 | 0.8364 | 13000 | 0.6107 |
| 0.5262 | 0.9008 | 14000 | 0.6066 |
| 0.6386 | 0.9651 | 15000 | 0.6056 |