teknium/GPT4-LLM-Cleaned
Viewer • Updated • 54.6k • 960 • 165
How to use TRAC-MTRY/traclm-v1-3b-instruct with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="TRAC-MTRY/traclm-v1-3b-instruct")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("TRAC-MTRY/traclm-v1-3b-instruct")
model = AutoModelForCausalLM.from_pretrained("TRAC-MTRY/traclm-v1-3b-instruct")
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 TRAC-MTRY/traclm-v1-3b-instruct with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "TRAC-MTRY/traclm-v1-3b-instruct"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "TRAC-MTRY/traclm-v1-3b-instruct",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/TRAC-MTRY/traclm-v1-3b-instruct
How to use TRAC-MTRY/traclm-v1-3b-instruct with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "TRAC-MTRY/traclm-v1-3b-instruct" \
--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": "TRAC-MTRY/traclm-v1-3b-instruct",
"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 "TRAC-MTRY/traclm-v1-3b-instruct" \
--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": "TRAC-MTRY/traclm-v1-3b-instruct",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use TRAC-MTRY/traclm-v1-3b-instruct with Docker Model Runner:
docker model run hf.co/TRAC-MTRY/traclm-v1-3b-instruct
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 11.2812 | 0.0 | 1 | 11.5156 |
| 5.0938 | 0.2 | 62 | 5.1016 |
| 3.5703 | 0.4 | 124 | 3.7161 |
| 2.582 | 0.6 | 186 | 2.9010 |
| 2.2109 | 0.8 | 248 | 2.5156 |
| 1.9824 | 1.0 | 310 | 2.3477 |
| 1.8594 | 1.18 | 372 | 2.1960 |
| 1.748 | 1.38 | 434 | 2.1667 |
| 1.748 | 1.58 | 496 | 2.0195 |
| 1.7617 | 1.78 | 558 | 2.0749 |
| 1.6582 | 1.98 | 620 | 1.9095 |
| 1.5762 | 2.16 | 682 | 1.9036 |
| 1.5586 | 2.36 | 744 | 1.8457 |
| 1.6016 | 2.56 | 806 | 1.8112 |
| 1.5195 | 2.76 | 868 | 1.8034 |
| 1.5645 | 2.96 | 930 | 1.7773 |
| 1.457 | 3.14 | 992 | 1.7474 |
| 1.4883 | 3.34 | 1054 | 1.7467 |
| 1.4648 | 3.54 | 1116 | 1.7676 |
| 1.5195 | 3.74 | 1178 | 1.7383 |
| 1.4531 | 3.94 | 1240 | 1.7383 |
| 1.4648 | 4.12 | 1302 | 1.7181 |
| 1.4121 | 4.32 | 1364 | 1.7272 |
| 1.4727 | 4.52 | 1426 | 1.7259 |
| 1.4219 | 4.72 | 1488 | 1.7240 |
| 1.5137 | 4.92 | 1550 | 1.7227 |