This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /let slopFactor {: msg= mode=score | |
| /re-replace find=/’/gims replace="'" {{var::msg}} | | |
| /re-replace find=/[“”]/gims replace="\"" {{pipe}} | /var msg | //"| | |
| /let modes ["regex","fuzzy"] | | |
| /let patterns [ | |
| {"name":"em-dash","weight":10,"mode":"regex","pattern":"/—/gms"}, | |
| {"name":"slop-names","weight":3,"mode":"fuzzy","threshold":0.1,"pattern": | |
| ["Elara","Vance","Voss","Seraphina","Kael","Leo","Jax","Thalric","Lyra","Aerith","Kaelen","Sylas","Valerius", | |
| "Nova","Aurora","Zenith","Aether","Celeste","Seraphina", | |
| "Oliver","Emily","Sophia","Liam","Noah","Ava"]}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {%- macro format_parameters(properties, required) -%} | |
| {%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%} | |
| {%- set ns = namespace(found_first=false) -%} | |
| {%- for key, value in properties | dictsort -%} | |
| {%- set add_comma = false -%} | |
| {%- if key not in standard_keys -%} | |
| {%- if ns.found_first %},{% endif -%} | |
| {%- set ns.found_first = true -%} | |
| {{ key }}:{ | |
| {%- if value['description'] -%} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| update_gguf_jinja.py — Replace a metadata string key in a GGUF model file. | |
| By default replaces tokenizer.chat_template with the contents of a .jinja | |
| file. Writes a new output file; the source is never modified. | |
| Usage examples: | |
| python update_gguf_jinja.py model.gguf template.jinja | |
| python update_gguf_jinja.py model.gguf template.jinja -o patched.gguf |