Text Generation
Transformers
Safetensors
phi3
EMO
conversational
custom_code
text-generation-inference
Instructions to use OEvortex/EMO-phi-128k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OEvortex/EMO-phi-128k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OEvortex/EMO-phi-128k", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OEvortex/EMO-phi-128k", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("OEvortex/EMO-phi-128k", trust_remote_code=True) 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 OEvortex/EMO-phi-128k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OEvortex/EMO-phi-128k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OEvortex/EMO-phi-128k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OEvortex/EMO-phi-128k
- SGLang
How to use OEvortex/EMO-phi-128k 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 "OEvortex/EMO-phi-128k" \ --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": "OEvortex/EMO-phi-128k", "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 "OEvortex/EMO-phi-128k" \ --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": "OEvortex/EMO-phi-128k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use OEvortex/EMO-phi-128k with Docker Model Runner:
docker model run hf.co/OEvortex/EMO-phi-128k
chat template
Browse files- special_tokens_map.json +22 -17
- tokenizer.json +0 -1
- tokenizer_config.json +2 -4
special_tokens_map.json
CHANGED
|
@@ -1,23 +1,28 @@
|
|
| 1 |
{
|
| 2 |
"additional_special_tokens": [
|
| 3 |
-
|
| 4 |
-
"content": "<|im_start|>",
|
| 5 |
-
"lstrip": false,
|
| 6 |
-
"normalized": false,
|
| 7 |
-
"rstrip": false,
|
| 8 |
-
"single_word": false
|
| 9 |
-
},
|
| 10 |
-
{
|
| 11 |
-
"content": "<|im_end|>",
|
| 12 |
-
"lstrip": false,
|
| 13 |
-
"normalized": false,
|
| 14 |
-
"rstrip": false,
|
| 15 |
-
"single_word": false
|
| 16 |
-
}
|
| 17 |
],
|
| 18 |
-
"bos_token":
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
"unk_token": {
|
| 22 |
"content": "<unk>",
|
| 23 |
"lstrip": false,
|
|
|
|
| 1 |
{
|
| 2 |
"additional_special_tokens": [
|
| 3 |
+
"<|/inst|>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
],
|
| 5 |
+
"bos_token": {
|
| 6 |
+
"content": "<s>",
|
| 7 |
+
"lstrip": false,
|
| 8 |
+
"normalized": false,
|
| 9 |
+
"rstrip": false,
|
| 10 |
+
"single_word": false
|
| 11 |
+
},
|
| 12 |
+
"eos_token": {
|
| 13 |
+
"content": "<|endoftext|>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": false,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false
|
| 18 |
+
},
|
| 19 |
+
"pad_token": {
|
| 20 |
+
"content": "<|endoftext|>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false
|
| 25 |
+
},
|
| 26 |
"unk_token": {
|
| 27 |
"content": "<unk>",
|
| 28 |
"lstrip": false,
|
tokenizer.json
CHANGED
|
@@ -494,7 +494,6 @@
|
|
| 494 |
"end_of_word_suffix": null,
|
| 495 |
"fuse_unk": true,
|
| 496 |
"byte_fallback": true,
|
| 497 |
-
"ignore_merges": false,
|
| 498 |
"vocab": {
|
| 499 |
"<unk>": 0,
|
| 500 |
"<s>": 1,
|
|
|
|
| 494 |
"end_of_word_suffix": null,
|
| 495 |
"fuse_unk": true,
|
| 496 |
"byte_fallback": true,
|
|
|
|
| 497 |
"vocab": {
|
| 498 |
"<unk>": 0,
|
| 499 |
"<s>": 1,
|
tokenizer_config.json
CHANGED
|
@@ -1,6 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"add_bos_token": true,
|
| 3 |
-
"add_eos_token": false,
|
| 4 |
"added_tokens_decoder": {
|
| 5 |
"0": {
|
| 6 |
"content": "<unk>",
|
|
@@ -351,7 +349,7 @@
|
|
| 351 |
"<|/inst|>"
|
| 352 |
],
|
| 353 |
"bos_token": "<s>",
|
| 354 |
-
"chat_template": "{{ bos_token }}{% for message in messages %}{{'<|' + message['role'] + '|>' + '
|
| 355 |
"clean_up_tokenization_spaces": false,
|
| 356 |
"eos_token": "<|endoftext|>",
|
| 357 |
"legacy": false,
|
|
@@ -362,4 +360,4 @@
|
|
| 362 |
"tokenizer_class": "LlamaTokenizer",
|
| 363 |
"unk_token": "<unk>",
|
| 364 |
"use_default_system_prompt": false
|
| 365 |
-
}
|
|
|
|
| 1 |
{
|
|
|
|
|
|
|
| 2 |
"added_tokens_decoder": {
|
| 3 |
"0": {
|
| 4 |
"content": "<unk>",
|
|
|
|
| 349 |
"<|/inst|>"
|
| 350 |
],
|
| 351 |
"bos_token": "<s>",
|
| 352 |
+
"chat_template": "{{ bos_token }}{% for message in messages %}{{'<|' + message['role'] + '|>' + '' + message['content'] + '<|end|>' }}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>' }}{% else %}{{ eos_token }}{% endif %}",
|
| 353 |
"clean_up_tokenization_spaces": false,
|
| 354 |
"eos_token": "<|endoftext|>",
|
| 355 |
"legacy": false,
|
|
|
|
| 360 |
"tokenizer_class": "LlamaTokenizer",
|
| 361 |
"unk_token": "<unk>",
|
| 362 |
"use_default_system_prompt": false
|
| 363 |
+
}
|