Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Improve error messages for model validation and gated model handling
Browse files
backend/app/utils/model_validation.py
CHANGED
@@ -196,15 +196,15 @@ class ModelValidator:
|
|
196 |
token=self.token
|
197 |
)
|
198 |
except ValueError as e:
|
199 |
-
return False, f"
|
200 |
except Exception:
|
201 |
-
return False, "
|
202 |
|
203 |
return True, None, config
|
204 |
|
205 |
except ValueError:
|
206 |
-
return False, "
|
207 |
except Exception as e:
|
208 |
if "You are trying to access a gated repo." in str(e):
|
209 |
-
return True, "
|
210 |
-
return False, f"was not found or misconfigured on the
|
|
|
196 |
token=self.token
|
197 |
)
|
198 |
except ValueError as e:
|
199 |
+
return False, f"The tokenizer is not available in an official Transformers release: {e}", None
|
200 |
except Exception:
|
201 |
+
return False, "The tokenizer cannot be loaded. Ensure the tokenizer class is part of a stable Transformers release and correctly configured.", None
|
202 |
|
203 |
return True, None, config
|
204 |
|
205 |
except ValueError:
|
206 |
+
return False, "The model requires `trust_remote_code=True` to launch, and for safety reasons, we don't accept such models automatically.", None
|
207 |
except Exception as e:
|
208 |
if "You are trying to access a gated repo." in str(e):
|
209 |
+
return True, "The model is gated and requires special access permissions.", None
|
210 |
+
return False, f"The model was not found or is misconfigured on the Hub. Error: {e.args[0]}", None
|