Skip to content

fix: Replace bare except with explicit RuntimeError handling (#101)#102

Open
somdipto wants to merge 3 commits into
sapientinc:mainfrom
somdipto:main
Open

fix: Replace bare except with explicit RuntimeError handling (#101)#102
somdipto wants to merge 3 commits into
sapientinc:mainfrom
somdipto:main

Conversation

@somdipto

Copy link
Copy Markdown

Summary

Fixed the bare except: clause in evaluate.py that was catching all exceptions including KeyboardInterrupt and SystemExit.

Changes

  • Replaced bare except: with explicit RuntimeError handling
  • Added specific check for torch.compile prefix issues
  • Load checkpoint once to avoid redundant I/O
  • Re-raise other errors instead of silently hiding them

Testing

  • Works with normal checkpoints
  • Works with torch.compile checkpoints
  • Properly propagates other errors

Linked Issue

Fixes #101

@somdipto

Copy link
Copy Markdown
Author

hey guys can you please review my PR and leme know if there are any issue in that

…h and detailed Mermaid architecture diagrams
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.

Replace bare except with explicit exception in model loading (evaluate.py)

1 participant