Text Generation
Transformers
ONNX
Transformers.js
lfm2
emoji
thinking
chain-of-thought
pantheon
unsloth
lfm
webgpu
conversational
Instructions to use shreyask/pantheon-ui-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shreyask/pantheon-ui-onnx with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shreyask/pantheon-ui-onnx") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("shreyask/pantheon-ui-onnx") model = AutoModelForCausalLM.from_pretrained("shreyask/pantheon-ui-onnx", 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]:])) - Transformers.js
How to use shreyask/pantheon-ui-onnx with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'shreyask/pantheon-ui-onnx'); - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shreyask/pantheon-ui-onnx with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shreyask/pantheon-ui-onnx" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shreyask/pantheon-ui-onnx", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/shreyask/pantheon-ui-onnx
- SGLang
How to use shreyask/pantheon-ui-onnx 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 "shreyask/pantheon-ui-onnx" \ --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": "shreyask/pantheon-ui-onnx", "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 "shreyask/pantheon-ui-onnx" \ --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": "shreyask/pantheon-ui-onnx", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use shreyask/pantheon-ui-onnx 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 shreyask/pantheon-ui-onnx 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 shreyask/pantheon-ui-onnx to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for shreyask/pantheon-ui-onnx to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="shreyask/pantheon-ui-onnx", max_seq_length=2048, ) - Docker Model Runner
How to use shreyask/pantheon-ui-onnx with Docker Model Runner:
docker model run hf.co/shreyask/pantheon-ui-onnx
fix: add tokenizer_config with chat_template from base model
Browse files- tokenizer_config.json +4 -4
tokenizer_config.json
CHANGED
|
@@ -9,12 +9,12 @@
|
|
| 9 |
"input_ids",
|
| 10 |
"attention_mask"
|
| 11 |
],
|
| 12 |
-
"model_max_length":
|
| 13 |
"pad_token": "<|pad|>",
|
| 14 |
-
"padding_side": "left",
|
| 15 |
"sp_model_kwargs": {},
|
| 16 |
"spaces_between_special_tokens": false,
|
| 17 |
"tokenizer_class": "TokenizersBackend",
|
| 18 |
"use_default_system_prompt": false,
|
| 19 |
-
"use_fast": true
|
| 20 |
-
}
|
|
|
|
|
|
| 9 |
"input_ids",
|
| 10 |
"attention_mask"
|
| 11 |
],
|
| 12 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 13 |
"pad_token": "<|pad|>",
|
|
|
|
| 14 |
"sp_model_kwargs": {},
|
| 15 |
"spaces_between_special_tokens": false,
|
| 16 |
"tokenizer_class": "TokenizersBackend",
|
| 17 |
"use_default_system_prompt": false,
|
| 18 |
+
"use_fast": true,
|
| 19 |
+
"chat_template": "{{- bos_token -}}\n{%- set keep_past_thinking = keep_past_thinking | default(false) -%}\n{%- set ns = namespace(system_prompt=\"\") -%}\n{%- if messages[0][\"role\"] == \"system\" -%}\n {%- set ns.system_prompt = messages[0][\"content\"] -%}\n {%- set messages = messages[1:] -%}\n{%- endif -%}\n{%- if tools -%}\n {%- set ns.system_prompt = ns.system_prompt + (\"\\n\" if ns.system_prompt else \"\") + \"List of tools: [\" -%}\n {%- for tool in tools -%}\n {%- if tool is not string -%}\n {%- set tool = tool | tojson -%}\n {%- endif -%}\n {%- set ns.system_prompt = ns.system_prompt + tool -%}\n {%- if not loop.last -%}\n {%- set ns.system_prompt = ns.system_prompt + \", \" -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set ns.system_prompt = ns.system_prompt + \"]\" -%}\n{%- endif -%}\n{%- if ns.system_prompt -%}\n {{- \"<|im_start|>system\\n\" + ns.system_prompt + \"<|im_end|>\\n\" -}}\n{%- endif -%}\n{%- set ns.last_assistant_index = -1 -%}\n{%- for message in messages -%}\n {%- if message[\"role\"] == \"assistant\" -%}\n {%- set ns.last_assistant_index = loop.index0 -%}\n {%- endif -%}\n{%- endfor -%}\n{%- for message in messages -%}\n {{- \"<|im_start|>\" + message[\"role\"] + \"\\n\" -}}\n {%- set content = message[\"content\"] -%}\n {%- if content is not string -%}\n {%- set content = content | tojson -%}\n {%- endif -%}\n {%- if message[\"role\"] == \"assistant\" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}\n {%- if \"</think>\" in content -%}\n {%- set content = content.split(\"</think>\")[-1] | trim -%}\n {%- endif -%}\n {%- endif -%}\n {{- content + \"<|im_end|>\\n\" -}}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{- \"<|im_start|>assistant\\n\" -}}\n{%- endif -%}"
|
| 20 |
+
}
|