Transformers
GGUF
English
Chinese
chat-template
reasoning
cot
protium
solstice-ai
objective-gated
zero-waste
dynamic-reasoning
ollama
llama.cpp
vllm
Instructions to use Solstice-AI/Protium-1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Solstice-AI/Protium-1.0 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Solstice-AI/Protium-1.0", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Delete generate_family_templates.py
Browse files- generate_family_templates.py +0 -106
generate_family_templates.py
DELETED
|
@@ -1,106 +0,0 @@
|
|
| 1 |
-
import re
|
| 2 |
-
import jinja2
|
| 3 |
-
|
| 4 |
-
# 1. Generate universal.jinja from qwen.jinja base with universal tags
|
| 5 |
-
with open("/Users/shreyangondaliya/solstice_quants/HyperSynapse-SAS-Chat-Templates/templates/qwen.jinja") as f:
|
| 6 |
-
qwen_content = f.read()
|
| 7 |
-
|
| 8 |
-
# For universal.jinja:
|
| 9 |
-
# Header:
|
| 10 |
-
universal_header = """{#- ================================================================= -#}
|
| 11 |
-
{#- HyperSynapse-SAS (SelfAgentSwarm) 10-Level Cognitive Architecture -#}
|
| 12 |
-
{#- Model-Agnostic / Universal ChatML Chat Template -#}
|
| 13 |
-
{#- Compatible with any LLM runtime (llama.cpp, vLLM, SGLang, Ollama) -#}
|
| 14 |
-
{#- Levels: 0=Mortal/Disabled, 1=Hermes/ulow, 2=Apollo/low, -#}
|
| 15 |
-
{#- 3=Artemis/lmed, 4=Athena/medium, 5=Prometheus/mhigh, -#}
|
| 16 |
-
{#- 6=Solstice/high, 7=Hyperion/xhigh (Default), 8=Einstein (Solo), -#}
|
| 17 |
-
{#- 9=Oracle (Solo). Swarm: swarm (20-Agent), deep-swarm (Council) -#}
|
| 18 |
-
{#- ================================================================= -#}
|
| 19 |
-
"""
|
| 20 |
-
|
| 21 |
-
universal_content = universal_header + qwen_content[qwen_content.find("{%- set inst_hermes -%}"):]
|
| 22 |
-
with open("/Users/shreyangondaliya/solstice_quants/HyperSynapse-SAS-Chat-Templates/templates/universal.jinja", "w") as f:
|
| 23 |
-
f.write(universal_content)
|
| 24 |
-
|
| 25 |
-
print("Created universal.jinja!")
|
| 26 |
-
|
| 27 |
-
# 2. Build Llama 3 / 4 template
|
| 28 |
-
# In Llama 3 / 4, special tokens are:
|
| 29 |
-
# <|begin_of_text|>
|
| 30 |
-
# <|start_header_id|>system<|end_header_id|>\n\n...<|eot_id|>
|
| 31 |
-
# <|start_header_id|>user<|end_header_id|>\n\n...<|eot_id|>
|
| 32 |
-
# <|start_header_id|>assistant<|end_header_id|>\n\n...<|eot_id|>
|
| 33 |
-
|
| 34 |
-
llama_header = """{#- ================================================================= -#}
|
| 35 |
-
{#- HyperSynapse-SAS (SelfAgentSwarm) 10-Level Cognitive Architecture -#}
|
| 36 |
-
{#- Tailored for Meta Llama 3 / 3.1 / 3.2 / 3.3 / Llama 4 -#}
|
| 37 |
-
{#- Levels: 0=Mortal/Disabled, 1=Hermes/ulow, 2=Apollo/low, -#}
|
| 38 |
-
{#- 3=Artemis/lmed, 4=Athena/medium, 5=Prometheus/mhigh, -#}
|
| 39 |
-
{#- 6=Solstice/high, 7=Hyperion/xhigh (Default), 8=Einstein (Solo), -#}
|
| 40 |
-
{#- 9=Oracle (Solo). Swarm: swarm (20-Agent), deep-swarm (Council) -#}
|
| 41 |
-
{#- ================================================================= -#}
|
| 42 |
-
"""
|
| 43 |
-
|
| 44 |
-
# Replace ChatML tokens in qwen rendering section with Llama tokens
|
| 45 |
-
qwen_instructions_part = qwen_content[qwen_content.find("{%- set inst_hermes -%}"):qwen_content.find("{%- set ns = namespace(")]
|
| 46 |
-
qwen_logic_part = qwen_content[qwen_content.find("{%- set ns = namespace("):]
|
| 47 |
-
|
| 48 |
-
# Adapt rendering logic for Llama
|
| 49 |
-
llama_render = qwen_logic_part.replace("<|im_start|>system\\n", "<|start_header_id|>system<|end_header_id|>\\n\\n")
|
| 50 |
-
llama_render = llama_render.replace("<|im_start|>user\\n", "<|start_header_id|>user<|end_header_id|>\\n\\n")
|
| 51 |
-
llama_render = llama_render.replace("<|im_start|>assistant\\n", "<|start_header_id|>assistant<|end_header_id|>\\n\\n")
|
| 52 |
-
llama_render = llama_render.replace("<|im_start|>developer\\n", "<|start_header_id|>developer<|end_header_id|>\\n\\n")
|
| 53 |
-
llama_render = llama_render.replace("<|im_end|>\\n", "<|eot_id|>\\n")
|
| 54 |
-
llama_render = llama_render.replace("<|im_end|>", "<|eot_id|>")
|
| 55 |
-
|
| 56 |
-
llama_content = llama_header + qwen_instructions_part + "{{- bos_token -}}\n" + llama_render
|
| 57 |
-
with open("/Users/shreyangondaliya/solstice_quants/HyperSynapse-SAS-Chat-Templates/templates/llama3.jinja", "w") as f:
|
| 58 |
-
f.write(llama_content)
|
| 59 |
-
|
| 60 |
-
print("Created llama3.jinja!")
|
| 61 |
-
|
| 62 |
-
# 3. Build Mistral template
|
| 63 |
-
mistral_header = """{#- ================================================================= -#}
|
| 64 |
-
{#- HyperSynapse-SAS (SelfAgentSwarm) 10-Level Cognitive Architecture -#}
|
| 65 |
-
{#- Tailored for Mistral / Mixtral / Codestral / Pixtral -#}
|
| 66 |
-
{#- Levels: 0=Mortal/Disabled, 1=Hermes/ulow, 2=Apollo/low, -#}
|
| 67 |
-
{#- 3=Artemis/lmed, 4=Athena/medium, 5=Prometheus/mhigh, -#}
|
| 68 |
-
{#- 6=Solstice/high, 7=Hyperion/xhigh (Default), 8=Einstein (Solo), -#}
|
| 69 |
-
{#- 9=Oracle (Solo). Swarm: swarm (20-Agent), deep-swarm (Council) -#}
|
| 70 |
-
{#- ================================================================= -#}
|
| 71 |
-
"""
|
| 72 |
-
# Mistral uses [INST] and [/INST]
|
| 73 |
-
mistral_render = qwen_logic_part.replace("<|im_start|>system\\n", "[INST] ")
|
| 74 |
-
mistral_render = mistral_render.replace("<|im_start|>user\\n", "[INST] ")
|
| 75 |
-
mistral_render = mistral_render.replace("<|im_start|>assistant\\n", "")
|
| 76 |
-
mistral_render = mistral_render.replace("<|im_end|>\\n", " [/INST]\n")
|
| 77 |
-
mistral_render = mistral_render.replace("<|im_end|>", " [/INST]")
|
| 78 |
-
|
| 79 |
-
mistral_content = mistral_header + qwen_instructions_part + "{{- bos_token -}}\n" + mistral_render
|
| 80 |
-
with open("/Users/shreyangondaliya/solstice_quants/HyperSynapse-SAS-Chat-Templates/templates/mistral.jinja", "w") as f:
|
| 81 |
-
f.write(mistral_content)
|
| 82 |
-
|
| 83 |
-
print("Created mistral.jinja!")
|
| 84 |
-
|
| 85 |
-
# 4. Build Gemma template
|
| 86 |
-
gemma_header = """{#- ================================================================= -#}
|
| 87 |
-
{#- HyperSynapse-SAS (SelfAgentSwarm) 10-Level Cognitive Architecture -#}
|
| 88 |
-
{#- Tailored for Google Gemma 2 / Gemma 3 / Gemma 4 -#}
|
| 89 |
-
{#- Levels: 0=Mortal/Disabled, 1=Hermes/ulow, 2=Apollo/low, -#}
|
| 90 |
-
{#- 3=Artemis/lmed, 4=Athena/medium, 5=Prometheus/mhigh, -#}
|
| 91 |
-
{#- 6=Solstice/high, 7=Hyperion/xhigh (Default), 8=Einstein (Solo), -#}
|
| 92 |
-
{#- 9=Oracle (Solo). Swarm: swarm (20-Agent), deep-swarm (Council) -#}
|
| 93 |
-
{#- ================================================================= -#}
|
| 94 |
-
"""
|
| 95 |
-
gemma_render = qwen_logic_part.replace("<|im_start|>system\\n", "<start_of_turn>system\\n")
|
| 96 |
-
gemma_render = gemma_render.replace("<|im_start|>user\\n", "<start_of_turn>user\\n")
|
| 97 |
-
gemma_render = gemma_render.replace("<|im_start|>assistant\\n", "<start_of_turn>model\\n")
|
| 98 |
-
gemma_render = gemma_render.replace("<|im_start|>developer\\n", "<start_of_turn>system\\n")
|
| 99 |
-
gemma_render = gemma_render.replace("<|im_end|>\\n", "<end_of_turn>\\n")
|
| 100 |
-
gemma_render = gemma_render.replace("<|im_end|>", "<end_of_turn>")
|
| 101 |
-
|
| 102 |
-
gemma_content = gemma_header + qwen_instructions_part + "{{- bos_token -}}\n" + gemma_render
|
| 103 |
-
with open("/Users/shreyangondaliya/solstice_quants/HyperSynapse-SAS-Chat-Templates/templates/gemma.jinja", "w") as f:
|
| 104 |
-
f.write(gemma_content)
|
| 105 |
-
|
| 106 |
-
print("Created gemma.jinja!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|