Skip to content

fix(cli): Improve error messages in model info command with actionable guidance#7

Open
PredictiveManish wants to merge 15 commits into
Zyora-Dev:mainfrom
PredictiveManish:error-message-cli
Open

fix(cli): Improve error messages in model info command with actionable guidance#7
PredictiveManish wants to merge 15 commits into
Zyora-Dev:mainfrom
PredictiveManish:error-message-cli

Conversation

@PredictiveManish

Copy link
Copy Markdown
Contributor

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:

  • Clear identification of the error type
  • Actionable troubleshooting steps
  • Command examples for common fixes
  • Context-appropriate solutions based on the error pattern

Changes Made

1. Added Specific Exception Handlers

Exception Use Case Guidance Provided
ImportError Missing dependencies Install commands for transformers/torch
ConnectionError Network/proxy issues Proxy configuration, internet check
ValueError Invalid model name Correct format examples
FileNotFoundError Local path missing Path verification, pull command
PermissionError File permissions Permission fixes

2. Pattern-Based Error Detection

The generic handler now detects common error patterns:

Pattern Detection Solution
Authentication "401", "unauthorized" zse login command
Rate Limiting "429", "rate limit" Wait or use cache
Out of Memory "cuda", "out of memory" Smaller model or CPU
Not Found "404", "not found" Verify model ID

3. 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/tokens

Invalid 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

@PredictiveManish

Copy link
Copy Markdown
Contributor Author

@zyoraclub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants