Text Generation
Transformers
TensorBoard
Safetensors
gemma3_text
Generated from Trainer
sft
trl
conversational
text-generation-inference
Instructions to use sr5434/sft_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sr5434/sft_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sr5434/sft_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sr5434/sft_model") model = AutoModelForCausalLM.from_pretrained("sr5434/sft_model") 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 sr5434/sft_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sr5434/sft_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sr5434/sft_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sr5434/sft_model
- SGLang
How to use sr5434/sft_model 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 "sr5434/sft_model" \ --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": "sr5434/sft_model", "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 "sr5434/sft_model" \ --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": "sr5434/sft_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sr5434/sft_model with Docker Model Runner:
docker model run hf.co/sr5434/sft_model
End of training
Browse files
chat_template.jinja
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- for message in messages -%}
|
| 2 |
+
{%- set content = message.content if message.content is string else "" -%}
|
| 3 |
+
{%- if message.role == "user" -%}
|
| 4 |
+
{{ "<|im_start|>" + message.role + "
|
| 5 |
+
" + content + "<|im_end|>
|
| 6 |
+
" }}
|
| 7 |
+
{%- elif message.role == "assistant" -%}
|
| 8 |
+
{% generation %}
|
| 9 |
+
{{ "<|im_start|>assistant
|
| 10 |
+
" + content.lstrip("
|
| 11 |
+
") + "<|im_end|>
|
| 12 |
+
" }}
|
| 13 |
+
{% endgeneration %}
|
| 14 |
+
{%- endif -%}
|
| 15 |
+
{%- endfor -%}
|
| 16 |
+
{# ───── generation prompt ───── #}
|
| 17 |
+
{%- if add_generation_prompt -%}
|
| 18 |
+
|
| 19 |
+
{{ "<|im_start|>assistant
|
| 20 |
+
" + "<think>
|
| 21 |
+
|
| 22 |
+
</think>
|
| 23 |
+
" }}
|
| 24 |
+
{%- endif -%}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1072419256
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eb866034f112a448803d04d3b7d002c550a70365577704ec1108d4da329c663d
|
| 3 |
size 1072419256
|
runs/Feb15_17-56-53_9091ca24d601/events.out.tfevents.1771178979.9091ca24d601.64.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f71f95dc6fd303d876e0b00bb64edde6d50ed7ab83639f73bb5b4a48e54515cb
|
| 3 |
+
size 254603
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 6225
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c7b0494a970849945d2006eff4c85aa1f0ee1433bb201ecbefea81899e2ba093
|
| 3 |
size 6225
|