Text Generation
Transformers
Safetensors
English
gemma3_text
text-generation-inference
unsloth
conversational
Instructions to use Haple/nameparser with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Haple/nameparser with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Haple/nameparser") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Haple/nameparser") model = AutoModelForCausalLM.from_pretrained("Haple/nameparser", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Haple/nameparser with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Haple/nameparser" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Haple/nameparser", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Haple/nameparser
- SGLang
How to use Haple/nameparser 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 "Haple/nameparser" \ --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": "Haple/nameparser", "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 "Haple/nameparser" \ --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": "Haple/nameparser", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use Haple/nameparser with Docker Model Runner:
docker model run hf.co/Haple/nameparser
Upload model trained with Unsloth
Browse filesUpload model trained with Unsloth 2x faster
- chat_template.jinja +6 -3
- tokenizer_config.json +1 -1
chat_template.jinja
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
{{ bos_token }}
|
| 2 |
{%- if messages[0]['role'] == 'system' -%}
|
| 3 |
{%- if messages[0]['content'] is string -%}
|
|
@@ -35,13 +36,15 @@
|
|
| 35 |
{{ item['text'] | trim }}
|
| 36 |
{%- endif -%}
|
| 37 |
{%- endfor -%}
|
| 38 |
-
{%-
|
| 39 |
{{ raise_exception("Invalid content type") }}
|
| 40 |
{%- endif -%}
|
| 41 |
{{ '<end_of_turn>
|
| 42 |
' }}
|
| 43 |
{%- endfor -%}
|
| 44 |
{%- if add_generation_prompt -%}
|
| 45 |
-
{{
|
| 46 |
-
'
|
| 47 |
{%- endif -%}
|
|
|
|
|
|
|
|
|
| 1 |
+
{# Unsloth Chat template fixes #}
|
| 2 |
{{ bos_token }}
|
| 3 |
{%- if messages[0]['role'] == 'system' -%}
|
| 4 |
{%- if messages[0]['content'] is string -%}
|
|
|
|
| 36 |
{{ item['text'] | trim }}
|
| 37 |
{%- endif -%}
|
| 38 |
{%- endfor -%}
|
| 39 |
+
{%- elif message['content'] is defined -%}
|
| 40 |
{{ raise_exception("Invalid content type") }}
|
| 41 |
{%- endif -%}
|
| 42 |
{{ '<end_of_turn>
|
| 43 |
' }}
|
| 44 |
{%- endfor -%}
|
| 45 |
{%- if add_generation_prompt -%}
|
| 46 |
+
{{'<start_of_turn>model
|
| 47 |
+
'}}
|
| 48 |
{%- endif -%}
|
| 49 |
+
|
| 50 |
+
{# Copyright 2025-present Unsloth. Apache 2.0 License. #}
|
tokenizer_config.json
CHANGED
|
@@ -51336,7 +51336,7 @@
|
|
| 51336 |
"image_token": "<image_soft_token>",
|
| 51337 |
"model_max_length": 32768,
|
| 51338 |
"pad_token": "<pad>",
|
| 51339 |
-
"padding_side": "
|
| 51340 |
"sp_model_kwargs": null,
|
| 51341 |
"spaces_between_special_tokens": false,
|
| 51342 |
"tokenizer_class": "GemmaTokenizer",
|
|
|
|
| 51336 |
"image_token": "<image_soft_token>",
|
| 51337 |
"model_max_length": 32768,
|
| 51338 |
"pad_token": "<pad>",
|
| 51339 |
+
"padding_side": "left",
|
| 51340 |
"sp_model_kwargs": null,
|
| 51341 |
"spaces_between_special_tokens": false,
|
| 51342 |
"tokenizer_class": "GemmaTokenizer",
|