Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve typing annotations for public apis #538

Open
1 of 2 tasks
justinchuby opened this issue Nov 5, 2024 · 0 comments
Open
1 of 2 tasks

Improve typing annotations for public apis #538

justinchuby opened this issue Nov 5, 2024 · 0 comments

Comments

@justinchuby
Copy link

justinchuby commented Nov 5, 2024

System Info

Currently when using safe_open as a context manager, mypy will complain that

"safe_open" has no attribute "__enter__"

and

"safe_open" has no attribute "__exit__"

Information

  • The official example scripts
  • My own modified scripts

Reproduction

Check

with safetensors.safe_open(path, framework="numpy") as f:
    ...

with a type checker.

Expected behavior

There should be no errors

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

No branches or pull requests

1 participant