Text Generation
Transformers
PyTorch
Safetensors
English
tiny_smart_llm
gpt
language-model
conversational
custom_code
Instructions to use HenrySentinel/tinyMind with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HenrySentinel/tinyMind with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HenrySentinel/tinyMind", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("HenrySentinel/tinyMind", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HenrySentinel/tinyMind with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HenrySentinel/tinyMind" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HenrySentinel/tinyMind", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HenrySentinel/tinyMind
- SGLang
How to use HenrySentinel/tinyMind 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 "HenrySentinel/tinyMind" \ --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": "HenrySentinel/tinyMind", "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 "HenrySentinel/tinyMind" \ --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": "HenrySentinel/tinyMind", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HenrySentinel/tinyMind with Docker Model Runner:
docker model run hf.co/HenrySentinel/tinyMind
Update tokenizer with chat template and pad token
Browse files- tokenizer_config.json +2 -12
tokenizer_config.json
CHANGED
|
@@ -1,20 +1,10 @@
|
|
| 1 |
{
|
| 2 |
"add_prefix_space": false,
|
| 3 |
-
"added_tokens_decoder": {
|
| 4 |
-
"50256": {
|
| 5 |
-
"content": "<|endoftext|>",
|
| 6 |
-
"lstrip": false,
|
| 7 |
-
"normalized": true,
|
| 8 |
-
"rstrip": false,
|
| 9 |
-
"single_word": false,
|
| 10 |
-
"special": true
|
| 11 |
-
}
|
| 12 |
-
},
|
| 13 |
"bos_token": "<|endoftext|>",
|
|
|
|
| 14 |
"clean_up_tokenization_spaces": false,
|
| 15 |
"eos_token": "<|endoftext|>",
|
| 16 |
-
"
|
| 17 |
-
"model_max_length": 1024,
|
| 18 |
"pad_token": "<|endoftext|>",
|
| 19 |
"tokenizer_class": "GPT2Tokenizer",
|
| 20 |
"unk_token": "<|endoftext|>"
|
|
|
|
| 1 |
{
|
| 2 |
"add_prefix_space": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"bos_token": "<|endoftext|>",
|
| 4 |
+
"chat_template": "{% for message in messages %}{% if message['role'] == 'user' %}{{ '<|user|>\n' + message['content'] + '\n' }}{% elif message['role'] == 'assistant' %}{{ '<|assistant|>\n' + message['content'] + eos_token + '\n' }}{% elif message['role'] == 'system' %}{{ '<|system|>\n' + message['content'] + '\n' }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>\n' }}{% endif %}",
|
| 5 |
"clean_up_tokenization_spaces": false,
|
| 6 |
"eos_token": "<|endoftext|>",
|
| 7 |
+
"model_max_length": 512,
|
|
|
|
| 8 |
"pad_token": "<|endoftext|>",
|
| 9 |
"tokenizer_class": "GPT2Tokenizer",
|
| 10 |
"unk_token": "<|endoftext|>"
|