fix(cli): Improve error messages in model info command with actionable guidance#7
Open
PredictiveManish wants to merge 15 commits into
Open
fix(cli): Improve error messages in model info command with actionable guidance#7PredictiveManish wants to merge 15 commits into
PredictiveManish wants to merge 15 commits into
Conversation
Added sponsorship badge for ZSE.
Added a sponsorship message and badge to the README.
Updated sponsorship information and added mailto link.
Added guidelines for contributing to the ZSE project.
…g.md Setup and Installation for Contributors
Added Apache License 2.0 to the project.
fix: Add extra='ignore' to chat models for OpenAI client compatibility (Phase 1)
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
zse info <model>command currently shows generic error messages when a model fails to load (e.g.,[red]Error analyzing model: {e}[/red]). This provides no actionable guidance to users, making it difficult to understand what went wrong and how to fix it.Solution
Replaced the generic exception handler in
_show_model_info_real()with specific error messages that provide:Changes Made
1. Added Specific Exception Handlers
ImportErrorConnectionErrorValueErrorFileNotFoundErrorPermissionError2. Pattern-Based Error Detection
The generic handler now detects common error patterns:
zse logincommand3. Actionable Guidance Examples
Authentication Error:
$ zse info meta-llama/Llama-3-8B Error analyzing model: AuthenticationError - 401 Client Error Common issues and solutions: • This model requires authentication (gated model) • Log in with: zse login • Get token from: https://huggingface.co/settings/tokensInvalid Model:
$ zse info llama-8b Error analyzing model: ValueError - Model not found Troubleshooting tips: • Check the model name spelling • Use format: organization/model-name (e.g., meta-llama/Llama-3-8B) • Or provide a local path to a model directory or .zse file Examples of valid model specifications: meta-llama/Llama-3-8B Qwen/Qwen2.5-7B-Instruct ./models/my-model.zse /path/to/huggingface/model