Text Generation
Transformers
PyTorch
English
mistral
text-generation-inference
unsloth
trl
sft
conversational
Instructions to use twright8/phim_q16_vllm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use twright8/phim_q16_vllm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="twright8/phim_q16_vllm") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("twright8/phim_q16_vllm") model = AutoModelForCausalLM.from_pretrained("twright8/phim_q16_vllm", 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 twright8/phim_q16_vllm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "twright8/phim_q16_vllm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "twright8/phim_q16_vllm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/twright8/phim_q16_vllm
- SGLang
How to use twright8/phim_q16_vllm 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 "twright8/phim_q16_vllm" \ --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": "twright8/phim_q16_vllm", "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 "twright8/phim_q16_vllm" \ --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": "twright8/phim_q16_vllm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use twright8/phim_q16_vllm 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 twright8/phim_q16_vllm 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 twright8/phim_q16_vllm to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for twright8/phim_q16_vllm to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="twright8/phim_q16_vllm", max_seq_length=2048, ) - Docker Model Runner
How to use twright8/phim_q16_vllm with Docker Model Runner:
docker model run hf.co/twright8/phim_q16_vllm
Upload tokenizer
Browse files- special_tokens_map.json +1 -1
- tokenizer.json +1 -1
- tokenizer_config.json +3 -3
special_tokens_map.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
| 17 |
"content": "<|placeholder6|>",
|
| 18 |
"lstrip": false,
|
| 19 |
"normalized": false,
|
| 20 |
-
"rstrip":
|
| 21 |
"single_word": false
|
| 22 |
},
|
| 23 |
"unk_token": {
|
|
|
|
| 17 |
"content": "<|placeholder6|>",
|
| 18 |
"lstrip": false,
|
| 19 |
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
"single_word": false
|
| 22 |
},
|
| 23 |
"unk_token": {
|
tokenizer.json
CHANGED
|
@@ -116,7 +116,7 @@
|
|
| 116 |
"content": "<|placeholder6|>",
|
| 117 |
"single_word": false,
|
| 118 |
"lstrip": false,
|
| 119 |
-
"rstrip":
|
| 120 |
"normalized": false,
|
| 121 |
"special": true
|
| 122 |
},
|
|
|
|
| 116 |
"content": "<|placeholder6|>",
|
| 117 |
"single_word": false,
|
| 118 |
"lstrip": false,
|
| 119 |
+
"rstrip": false,
|
| 120 |
"normalized": false,
|
| 121 |
"special": true
|
| 122 |
},
|
tokenizer_config.json
CHANGED
|
@@ -103,7 +103,7 @@
|
|
| 103 |
"content": "<|placeholder6|>",
|
| 104 |
"lstrip": false,
|
| 105 |
"normalized": false,
|
| 106 |
-
"rstrip":
|
| 107 |
"single_word": false,
|
| 108 |
"special": true
|
| 109 |
},
|
|
@@ -117,10 +117,10 @@
|
|
| 117 |
}
|
| 118 |
},
|
| 119 |
"bos_token": "<s>",
|
| 120 |
-
"chat_template": "{% for message in messages %}{% if
|
| 121 |
"clean_up_tokenization_spaces": false,
|
| 122 |
"eos_token": "<|endoftext|>",
|
| 123 |
-
"legacy":
|
| 124 |
"model_max_length": 4096,
|
| 125 |
"pad_token": "<|placeholder6|>",
|
| 126 |
"padding_side": "left",
|
|
|
|
| 103 |
"content": "<|placeholder6|>",
|
| 104 |
"lstrip": false,
|
| 105 |
"normalized": false,
|
| 106 |
+
"rstrip": false,
|
| 107 |
"single_word": false,
|
| 108 |
"special": true
|
| 109 |
},
|
|
|
|
| 117 |
}
|
| 118 |
},
|
| 119 |
"bos_token": "<s>",
|
| 120 |
+
"chat_template": "{% for message in messages %}{% if message['role'] == 'user' %}{{'<|user|>\n' + message['content'] + '<|end|>\n'}}{% elif message['role'] == 'assistant' %}{{'<|assistant|>\n' + message['content'] + '<|end|>\n'}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>\n' }}{% else %}{{ eos_token }}{% endif %}",
|
| 121 |
"clean_up_tokenization_spaces": false,
|
| 122 |
"eos_token": "<|endoftext|>",
|
| 123 |
+
"legacy": false,
|
| 124 |
"model_max_length": 4096,
|
| 125 |
"pad_token": "<|placeholder6|>",
|
| 126 |
"padding_side": "left",
|