Text Generation
Transformers
Safetensors
mistral
cemp
assisted-living
LoRA
tinyllama
conversational
text-generation-inference
Instructions to use alfboss/cempbot-tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alfboss/cempbot-tiny with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="alfboss/cempbot-tiny") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("alfboss/cempbot-tiny") model = AutoModelForCausalLM.from_pretrained("alfboss/cempbot-tiny") 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
- vLLM
How to use alfboss/cempbot-tiny with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "alfboss/cempbot-tiny" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alfboss/cempbot-tiny", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/alfboss/cempbot-tiny
- SGLang
How to use alfboss/cempbot-tiny 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 "alfboss/cempbot-tiny" \ --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": "alfboss/cempbot-tiny", "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 "alfboss/cempbot-tiny" \ --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": "alfboss/cempbot-tiny", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use alfboss/cempbot-tiny with Docker Model Runner:
docker model run hf.co/alfboss/cempbot-tiny
v2.0.4 tokenizer push with consistent prompt formatting
Browse files- added_tokens.json +3 -0
- special_tokens_map.json +3 -0
- tokenizer.json +9 -0
- tokenizer_config.json +11 -0
added_tokens.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"<|endofanswer|>": 32000
|
| 3 |
+
}
|
special_tokens_map.json
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
{
|
|
|
|
|
|
|
|
|
|
| 2 |
"bos_token": {
|
| 3 |
"content": "<s>",
|
| 4 |
"lstrip": false,
|
|
|
|
| 1 |
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
"<|endofanswer|>"
|
| 4 |
+
],
|
| 5 |
"bos_token": {
|
| 6 |
"content": "<s>",
|
| 7 |
"lstrip": false,
|
tokenizer.json
CHANGED
|
@@ -43,6 +43,15 @@
|
|
| 43 |
"rstrip": false,
|
| 44 |
"normalized": false,
|
| 45 |
"special": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
}
|
| 47 |
],
|
| 48 |
"normalizer": {
|
|
|
|
| 43 |
"rstrip": false,
|
| 44 |
"normalized": false,
|
| 45 |
"special": true
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"id": 32000,
|
| 49 |
+
"content": "<|endofanswer|>",
|
| 50 |
+
"single_word": false,
|
| 51 |
+
"lstrip": false,
|
| 52 |
+
"rstrip": false,
|
| 53 |
+
"normalized": false,
|
| 54 |
+
"special": true
|
| 55 |
}
|
| 56 |
],
|
| 57 |
"normalizer": {
|
tokenizer_config.json
CHANGED
|
@@ -26,8 +26,19 @@
|
|
| 26 |
"rstrip": false,
|
| 27 |
"single_word": false,
|
| 28 |
"special": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
}
|
| 30 |
},
|
|
|
|
|
|
|
|
|
|
| 31 |
"bos_token": "<s>",
|
| 32 |
"chat_template": "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'system' %}\n{{ '<|system|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|assistant|>\n' + message['content'] + eos_token }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|assistant|>' }}\n{% endif %}\n{% endfor %}",
|
| 33 |
"clean_up_tokenization_spaces": false,
|
|
|
|
| 26 |
"rstrip": false,
|
| 27 |
"single_word": false,
|
| 28 |
"special": true
|
| 29 |
+
},
|
| 30 |
+
"32000": {
|
| 31 |
+
"content": "<|endofanswer|>",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": false,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false,
|
| 36 |
+
"special": true
|
| 37 |
}
|
| 38 |
},
|
| 39 |
+
"additional_special_tokens": [
|
| 40 |
+
"<|endofanswer|>"
|
| 41 |
+
],
|
| 42 |
"bos_token": "<s>",
|
| 43 |
"chat_template": "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'system' %}\n{{ '<|system|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|assistant|>\n' + message['content'] + eos_token }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|assistant|>' }}\n{% endif %}\n{% endfor %}",
|
| 44 |
"clean_up_tokenization_spaces": false,
|