Skip to content

Commit f14800a

Browse files
committed
rollback loader.py
1 parent 56733b0 commit f14800a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

models/loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import warnings
66
from typing import Optional
77

8+
import torch
9+
810
from configs.model_config import DEVICE
911
from models.adapter import get_llm_model_adapter
1012
from models.compression import compress_module
@@ -52,7 +54,6 @@ class ModelLoader(metaclass=Singleton):
5254
def __init__(self, model_path) -> None:
5355
self.device = DEVICE
5456
self.model_path = model_path
55-
import torch
5657
self.kwargs = {
5758
"torch_dtype": torch.float16,
5859
"device_map": "auto",
@@ -67,7 +68,6 @@ def loader(
6768
cpu_offloading=False,
6869
max_gpu_memory: Optional[str] = None,
6970
):
70-
import torch
7171
if self.device == "cpu":
7272
kwargs = {"torch_dtype": torch.float32}
7373

0 commit comments

Comments
 (0)