Skip to content

Commit

Permalink
fix: handling cases where pytorch file is a single tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Nov 8, 2024
1 parent c40b642 commit 14d2d79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/handlers/pytorch/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def main():
all_metadata = getattr(model, "_metadata") if hasattr(model, "_metadata") else {}
model_metadata = all_metadata[""] if "" in all_metadata else {}

# some files are just a single tensor
if isinstance(model, torch.Tensor):
model = {"<unamed-single-tensor>": model}

inspection = {
"file_path": file_path,
"file_type": "PyTorch",
Expand Down

0 comments on commit 14d2d79

Please sign in to comment.