Spaces:
Runtime error
Runtime error
added edge case where model has no config
Browse files
app.py
CHANGED
@@ -131,6 +131,9 @@ def button_click(hf_model_id, conv_template, quantization, oauth_token: gr.OAuth
|
|
131 |
if type(model_info) != huggingface_hub.hf_api.ModelInfo:
|
132 |
os.system("rm -rf dist/")
|
133 |
return "Entered Huggingface model ID is not a model repository"
|
|
|
|
|
|
|
134 |
if model_info.config['model_type'] not in SUPPORTED_MODEL_TYPES:
|
135 |
os.system("rm -rf dist/")
|
136 |
return f"Model type ({model_info.config['model_type']}) currently not supported by MLC-LLM"
|
|
|
131 |
if type(model_info) != huggingface_hub.hf_api.ModelInfo:
|
132 |
os.system("rm -rf dist/")
|
133 |
return "Entered Huggingface model ID is not a model repository"
|
134 |
+
if "model_type" not in model_info.config:
|
135 |
+
os.system("rm -rf dist/")
|
136 |
+
return "Cannot infer model type from config file"
|
137 |
if model_info.config['model_type'] not in SUPPORTED_MODEL_TYPES:
|
138 |
os.system("rm -rf dist/")
|
139 |
return f"Model type ({model_info.config['model_type']}) currently not supported by MLC-LLM"
|