Text Generation
Transformers
Safetensors
llama
glq
quantized
e8-lattice
conversational
text-generation-inference
Instructions to use xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw") model = AutoModelForCausalLM.from_pretrained("xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw
- SGLang
How to use xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw 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 "xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw" \ --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": "xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw", "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 "xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw" \ --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": "xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw with Docker Model Runner:
docker model run hf.co/xv0y5ncu/SmolLM2-135M-Instruct-GLQ-4bpw
Fix tokenizer_config: tokenizer_class=GPT2TokenizerFast
Browse files- tokenizer_config.json +7 -0
tokenizer_config.json
CHANGED
|
@@ -4,14 +4,21 @@
|
|
| 4 |
"bos_token": "<|im_start|>",
|
| 5 |
"clean_up_tokenization_spaces": false,
|
| 6 |
"eos_token": "<|im_end|>",
|
|
|
|
| 7 |
"errors": "replace",
|
| 8 |
"extra_special_tokens": [
|
| 9 |
"<|im_start|>",
|
| 10 |
"<|im_end|>"
|
| 11 |
],
|
|
|
|
| 12 |
"is_local": false,
|
|
|
|
| 13 |
"model_max_length": 8192,
|
| 14 |
"pad_token": "<|im_end|>",
|
|
|
|
|
|
|
|
|
|
| 15 |
"unk_token": "<|endoftext|>",
|
|
|
|
| 16 |
"vocab_size": 49152
|
| 17 |
}
|
|
|
|
| 4 |
"bos_token": "<|im_start|>",
|
| 5 |
"clean_up_tokenization_spaces": false,
|
| 6 |
"eos_token": "<|im_end|>",
|
| 7 |
+
"eot_token": "▁<EOT>",
|
| 8 |
"errors": "replace",
|
| 9 |
"extra_special_tokens": [
|
| 10 |
"<|im_start|>",
|
| 11 |
"<|im_end|>"
|
| 12 |
],
|
| 13 |
+
"fill_token": "<FILL_ME>",
|
| 14 |
"is_local": false,
|
| 15 |
+
"middle_token": "▁<MID>",
|
| 16 |
"model_max_length": 8192,
|
| 17 |
"pad_token": "<|im_end|>",
|
| 18 |
+
"prefix_token": "▁<PRE>",
|
| 19 |
+
"suffix_token": "▁<SUF>",
|
| 20 |
+
"tokenizer_class": "GPT2TokenizerFast",
|
| 21 |
"unk_token": "<|endoftext|>",
|
| 22 |
+
"use_default_system_prompt": false,
|
| 23 |
"vocab_size": 49152
|
| 24 |
}
|