2121 "Google Gemma 3n" : "lmstudio-community/gemma-3n-E4B-it-MLX-bf16" ,
2222 "Llama 3.x" : "Steelskull/L3.3-Shakudo-70b" ,
2323 "Llama 4" : "nvidia/Llama-4-Scout-17B-16E-Instruct-FP8" ,
24- "Mistral V7 (with system prompt) " : "Doctor-Shotgun/MS3.2-24B-Magnum-Diamond" ,
25- "Mistral V3 " : "mistralai/Mistral-7B-Instruct-v0.3" ,
24+ "Mistral Tekken " : "Doctor-Shotgun/MS3.2-24B-Magnum-Diamond" ,
25+ "Mistral Non-Tekken " : "mistralai/Mistral-7B-Instruct-v0.3" ,
2626 "GLM-4" : "THUDM/glm-4-9b-chat-hf" ,
2727 "Phi 3.5" : "microsoft/Phi-3.5-mini-instruct" ,
2828 "Phi 4 (mini)" : "microsoft/Phi-4-mini-instruct" ,
3131 "Jamba" : "ai21labs/Jamba-tiny-dev" ,
3232 "Dots" : "rednote-hilab/dots.llm1.inst" ,
3333 "RWKV World" : "fla-hub/rwkv7-1.5B-world" ,
34+ "OpenAI Harmony" : "openai/gpt-oss-120b" ,
3435 "Mistral (Generic)" : "mistralai/Mistral-Nemo-Instruct-2407" ,
3536 "ChatML (Generic)" : "NewEden/Gemma-27B-chatml" ,
3637}
3738
3839AUTOGUESS_SKIP_ADAPTER_TESTS = {
39- "Mistral V3 " : {"system" }, # Poor system support
40+ "Mistral Non-Tekken " : {"system" }, # Poor system support
4041 "Mistral (Generic)" : {"system" }, # Poor system support
4142}
4243
@@ -58,10 +59,12 @@ def get_tokenizer_config_for_huggingface_model_id(huggingface_model_id: str):
5859 with open (fname ) as f :
5960 return json .load (f )
6061
61- for filename in ["tokenizer_config.json" , "chat_template.json" ]:
62+ for filename in ["tokenizer_config.json" , "chat_template.json" , "chat_template.jinja" ]:
6263 url = f"https://huggingface.co/{ huggingface_model_id } /resolve/main/{ filename } "
6364 response = requests .get (url )
6465 if response .status_code == 200 :
66+ if url .endswith (".jinja" ):
67+ return {"chat_template" : response .text }
6568 v = json .loads (response .text )
6669 if 'chat_template' in v :
6770 return v
@@ -113,9 +116,9 @@ def templ(rolelist):
113116 expect = system ("SyS-tEm" )
114117 templated = templ ([{"role" : "system" , "content" : "SyS-tEm" }, {"role" : "user" , "content" : "user" }])
115118 if expect not in templated :
116- return False , f"system role missing expected fragment { expect .replace ("\n " , "\\ n" )} : { templated .replace ("\n " , "\\ n" )} "
119+ return False , f"system role missing expected fragment\n \t adapter: { expect .replace ("\n " , "\\ n" )} \n \t tokenizer : { templated .replace ("\n " , "\\ n" )} "
117120
118- # Test user/asst/usernvidia/Llama-4-Scout-17B-16E-Instruct-FP8
121+ # Test user/asst/user
119122 expect = [
120123 user ("user_1" ),
121124 assistant ("asst_1" ),
@@ -129,17 +132,21 @@ def templ(rolelist):
129132 rem = templated
130133 for sub in expect :
131134 if sub not in rem :
132- return False , f"missing expected fragment { sub .replace ("\n " , "\\ n" )} : { rem .replace ("\n " , "\\ n" )} "
135+ return False , f"missing expected fragment\n \t adapter: { sub .replace ("\n " , "\\ n" )} \n \t tokenizer : { rem .replace ("\n " , "\\ n" )} "
133136 rem = rem .split (sub , 1 )[1 ]
134137 except jinja2 .exceptions .TemplateError as e :
135138 return False , f"template error: { e } "
136139 return True , None
137140
141+ filter = sys .argv [1 ] if len (sys .argv ) > 1 else None
142+
138143failures = 0
139144seen = set ()
140145namefmt = "{name:<" + str (max (len (name ) for name in AUTOGUESS_MAPPING .keys ())) + "}"
141146hmifmt = "{huggingface_model_id:<" + str (max (len (huggingface_model_id ) for huggingface_model_id in AUTOGUESS_MAPPING .values ())) + "}"
142147for name , huggingface_model_id in AUTOGUESS_MAPPING .items ():
148+ if filter and filter not in name :
149+ continue
143150 seen .add (name )
144151 if huggingface_model_id == "***UNKNOWN***" :
145152 print (namefmt .format (name = name ) + " = " + namefmt .format (name = "***UNKNOWN***" ) + " : PENDING" )
@@ -162,10 +169,11 @@ def templ(rolelist):
162169 print (namefmt .format (name = name ) + " = " + namefmt .format (name = matched ) + " : " + ("OK " if adaptercheck and name == matched else reason if not adaptercheck else "FAILURE" ) + " " + hmifmt .format (huggingface_model_id = huggingface_model_id ) + " " + sub_template )
163170 failures += name != matched or not adaptercheck
164171
165- for entry in autoguess :
166- if entry ['name' ] not in seen :
167- print (namefmt .format (name = entry ['name' ]) + " MISSING MAPPING" )
168- failures += 1
172+ if filter is None :
173+ for entry in autoguess :
174+ if entry ['name' ] not in seen :
175+ print (namefmt .format (name = entry ['name' ]) + " MISSING MAPPING" )
176+ failures += 1
169177
170178if failures > 0 :
171179 print (f"There were { failures } failure(s)!" )
0 commit comments