Text Generation
Transformers
Safetensors
English
gemma2
text-generation-inference
unsloth
trl
conversational
Instructions to use Natet/merged_model_test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Natet/merged_model_test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Natet/merged_model_test") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Natet/merged_model_test") model = AutoModelForCausalLM.from_pretrained("Natet/merged_model_test") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Natet/merged_model_test with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Natet/merged_model_test" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Natet/merged_model_test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Natet/merged_model_test
- SGLang
How to use Natet/merged_model_test 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 "Natet/merged_model_test" \ --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": "Natet/merged_model_test", "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 "Natet/merged_model_test" \ --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": "Natet/merged_model_test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use Natet/merged_model_test with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Natet/merged_model_test to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Natet/merged_model_test to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Natet/merged_model_test to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Natet/merged_model_test", max_seq_length=2048, ) - Docker Model Runner
How to use Natet/merged_model_test with Docker Model Runner:
docker model run hf.co/Natet/merged_model_test
Upload tokenizer
Browse files- special_tokens_map.json +0 -4
- tokenizer_config.json +5 -6
special_tokens_map.json
CHANGED
|
@@ -1,8 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"additional_special_tokens": [
|
| 3 |
-
"<start_of_turn>",
|
| 4 |
-
"<end_of_turn>"
|
| 5 |
-
],
|
| 6 |
"bos_token": {
|
| 7 |
"content": "<bos>",
|
| 8 |
"lstrip": false,
|
|
|
|
| 1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
"bos_token": {
|
| 3 |
"content": "<bos>",
|
| 4 |
"lstrip": false,
|
tokenizer_config.json
CHANGED
|
@@ -1995,18 +1995,17 @@
|
|
| 1995 |
"special": false
|
| 1996 |
}
|
| 1997 |
},
|
| 1998 |
-
"additional_special_tokens": [
|
| 1999 |
-
"<start_of_turn>",
|
| 2000 |
-
"<end_of_turn>"
|
| 2001 |
-
],
|
| 2002 |
"bos_token": "<bos>",
|
| 2003 |
-
"chat_template": "{{ bos_token }}{%
|
| 2004 |
"clean_up_tokenization_spaces": false,
|
| 2005 |
"eos_token": "<eos>",
|
| 2006 |
"extra_special_tokens": {},
|
|
|
|
| 2007 |
"model_max_length": 8192,
|
|
|
|
| 2008 |
"pad_token": "<pad>",
|
| 2009 |
-
"
|
|
|
|
| 2010 |
"sp_model_kwargs": {},
|
| 2011 |
"spaces_between_special_tokens": false,
|
| 2012 |
"tokenizer_class": "GemmaTokenizer",
|
|
|
|
| 1995 |
"special": false
|
| 1996 |
}
|
| 1997 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1998 |
"bos_token": "<bos>",
|
| 1999 |
+
"chat_template": "{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '\n' + message['content'] | trim + '<end_of_turn>\n' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model\n'}}{% endif %}",
|
| 2000 |
"clean_up_tokenization_spaces": false,
|
| 2001 |
"eos_token": "<eos>",
|
| 2002 |
"extra_special_tokens": {},
|
| 2003 |
+
"max_length": null,
|
| 2004 |
"model_max_length": 8192,
|
| 2005 |
+
"pad_to_multiple_of": null,
|
| 2006 |
"pad_token": "<pad>",
|
| 2007 |
+
"pad_token_type_id": 0,
|
| 2008 |
+
"padding_side": "left",
|
| 2009 |
"sp_model_kwargs": {},
|
| 2010 |
"spaces_between_special_tokens": false,
|
| 2011 |
"tokenizer_class": "GemmaTokenizer",
|