@@ -197,6 +197,12 @@ def test_apply_metadata_heuristic_from_model_card(self):
197
197
got = gguf .Metadata .apply_metadata_heuristic (gguf .Metadata (), model_card , None , None )
198
198
self .assertEqual (got , expect )
199
199
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
+
200
206
# Dataset spec is inferred from model id
201
207
model_card = {'datasets' : 'teknium/OpenHermes-2.5' }
202
208
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):
209
215
got = gguf .Metadata .apply_metadata_heuristic (gguf .Metadata (), model_card , None , None )
210
216
self .assertEqual (got , expect )
211
217
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
+
212
224
def test_apply_metadata_heuristic_from_hf_parameters (self ):
213
225
hf_params = {"_name_or_path" : "./hermes-2-pro-llama-3-8b-DPO" }
214
226
got = gguf .Metadata .apply_metadata_heuristic (gguf .Metadata (), model_card = None , hf_params = hf_params , model_path = None )
0 commit comments