Skip to content

Commit

Permalink
fix: add missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
LS authored and LS committed May 19, 2024
1 parent 9ca9cab commit 9b1ac96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/lorax_server/utils/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import TYPE_CHECKING, Set, Tuple, Union

import torch
from safetensors import safe_open
from safetensors.torch import load_file
from transformers import AutoConfig, AutoTokenizer, PreTrainedTokenizer

Expand Down Expand Up @@ -166,4 +167,4 @@ def load_module_weight(name: str, module: Union[torch.Tensor, str], device, dtyp

# module would be just the filename if lazy loading happened before
with safe_open(module, framework="pt", device=device) as f:
return f.get_tensor(name).to(dtype)
return f.get_tensor(name).to(dtype)

0 comments on commit 9b1ac96

Please sign in to comment.