Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flax/traceback_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Whether to filter flax frames from traceback.
_flax_filter_tracebacks = config.flax_filter_frames
# Flax specific set of paths to exclude from tracebacks.
_flax_exclusions = set()
_flax_exclusions = set() # type: ignore[var-annotated]
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignores:

flax/traceback_util.py:28: error: Need type annotation for "_flax_exclusions" (hint: "_flax_exclusions: set[<type>] = ...")  [var-annotated]



# re-import JAX symbol for convenience.
Expand Down
2 changes: 1 addition & 1 deletion flax/training/checkpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ def read_chunk(i):
else:
checkpoint_contents = fp.read()

state_dict = serialization.msgpack_restore(checkpoint_contents)
state_dict = serialization.msgpack_restore(bytes(checkpoint_contents))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes the issue:

flax/training/checkpoints.py:1166: error: Argument 1 to "msgpack_restore" has incompatible type "bytearray"; expected "bytes"  [arg-type]

state_dict = _restore_mpas(
state_dict,
target,
Expand Down
Loading