@@ -197,6 +197,12 @@ def test_apply_metadata_heuristic_from_model_card(self):
197197 got = gguf .Metadata .apply_metadata_heuristic (gguf .Metadata (), model_card , None , None )
198198 self .assertEqual (got , expect )
199199
200+ # Base Model spec is given directly
201+ model_card = {'base_models' : [{'name' : 'OpenHermes 2.5' , 'organization' : 'Teknium' , 'version' : '2.5' , 'repo_url' : 'https://huggingface.co/teknium/OpenHermes-2.5' }]}
202+ expect = gguf .Metadata (base_models = [{'name' : 'OpenHermes 2.5' , 'organization' : 'Teknium' , 'version' : '2.5' , 'repo_url' : 'https://huggingface.co/teknium/OpenHermes-2.5' }])
203+ got = gguf .Metadata .apply_metadata_heuristic (gguf .Metadata (), model_card , None , None )
204+ self .assertEqual (got , expect )
205+
200206 # Dataset spec is inferred from model id
201207 model_card = {'datasets' : 'teknium/OpenHermes-2.5' }
202208 expect = gguf .Metadata (datasets = [{'name' : 'OpenHermes 2.5' , 'organization' : 'Teknium' , 'version' : '2.5' , 'repo_url' : 'https://huggingface.co/teknium/OpenHermes-2.5' }])
@@ -209,6 +215,12 @@ def test_apply_metadata_heuristic_from_model_card(self):
209215 got = gguf .Metadata .apply_metadata_heuristic (gguf .Metadata (), model_card , None , None )
210216 self .assertEqual (got , expect )
211217
218+ # Dataset spec is given directly
219+ model_card = {'datasets' : [{'name' : 'OpenHermes 2.5' , 'organization' : 'Teknium' , 'version' : '2.5' , 'repo_url' : 'https://huggingface.co/teknium/OpenHermes-2.5' }]}
220+ expect = gguf .Metadata (datasets = [{'name' : 'OpenHermes 2.5' , 'organization' : 'Teknium' , 'version' : '2.5' , 'repo_url' : 'https://huggingface.co/teknium/OpenHermes-2.5' }])
221+ got = gguf .Metadata .apply_metadata_heuristic (gguf .Metadata (), model_card , None , None )
222+ self .assertEqual (got , expect )
223+
212224 def test_apply_metadata_heuristic_from_hf_parameters (self ):
213225 hf_params = {"_name_or_path" : "./hermes-2-pro-llama-3-8b-DPO" }
214226 got = gguf .Metadata .apply_metadata_heuristic (gguf .Metadata (), model_card = None , hf_params = hf_params , model_path = None )
0 commit comments