Skip to content

fix: add explicit IsADirectoryError for local directory paths#19

Merged
pipe1os merged 2 commits into
mainfrom
advisor/003-fix-local-dir-error
Jun 12, 2026
Merged

fix: add explicit IsADirectoryError for local directory paths#19
pipe1os merged 2 commits into
mainfrom
advisor/003-fix-local-dir-error

Conversation

@pipe1os

@pipe1os pipe1os commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds a dedicated IsADirectoryError check in the CLI path resolution to provide a helpful error message when the user attempts to analyze a local directory rather than a specific checkpoint file.

Motivation & Context

Currently, if a user points the CLI to a local directory (e.g., ./my_model/), the tool evaluates os.path.exists as true, but because the directory doesn't have an extension like .safetensors, it falls through to the final else block. The user then receives a confusing error. Adding a dedicated check for directories clarifies the necessary input format, improving DX.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes, no api changes)
  • Documentation update

Checklist

  • My code follows the code style of this project.
  • My commit messages follow the Conventional Commits format, are lowercase, imperative, and specific.
  • I have updated the documentation accordingly (if applicable).
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@pipe1os pipe1os merged commit 89e20e5 into main Jun 12, 2026
9 checks passed
@pipe1os pipe1os deleted the advisor/003-fix-local-dir-error branch June 12, 2026 09:03
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.

1 participant