File tree 1 file changed +13
-1
lines changed 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,11 @@ def get_config(
262
262
MISTRAL_CONFIG_NAME ,
263
263
revision = revision ):
264
264
config_format = ConfigFormat .MISTRAL
265
+ else :
266
+ raise ValueError (
267
+ "Could not detect config format for no config file found. "
268
+ "Ensure your model has either config.json (HF format) "
269
+ "or params.json (Mistral format)." )
265
270
266
271
except Exception as e :
267
272
error_message = (
@@ -324,7 +329,14 @@ def get_config(
324
329
elif config_format == ConfigFormat .MISTRAL :
325
330
config = load_params_config (model , revision , token = HF_TOKEN , ** kwargs )
326
331
else :
327
- raise ValueError (f"Unsupported config format: { config_format } " )
332
+ supported_formats = [
333
+ fmt .value for fmt in ConfigFormat if fmt != ConfigFormat .AUTO
334
+ ]
335
+ raise ValueError (
336
+ f"Unsupported config format: { config_format } . "
337
+ f"Supported formats are: { ', ' .join (supported_formats )} . "
338
+ f"Ensure your model uses one of these configuration formats "
339
+ f"or specify the correct format explicitly." )
328
340
329
341
# Special architecture mapping check for GGUF models
330
342
if is_gguf :
You can’t perform that action at this time.
0 commit comments