diff --git a/pilot/__init__.py b/pilot/__init__.py new file mode 100644 index 000000000..9244e14db --- /dev/null +++ b/pilot/__init__.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +__version__ = "0.0.1" diff --git a/configs/model_config.py b/pilot/configs/model_config.py similarity index 100% rename from configs/model_config.py rename to pilot/configs/model_config.py diff --git a/pilot/model/__init__.py b/pilot/model/__init__.py new file mode 100644 index 000000000..0c23b3d79 --- /dev/null +++ b/pilot/model/__init__.py @@ -0,0 +1,2 @@ + +from model.loader import * \ No newline at end of file diff --git a/pilot/model/loader.py b/pilot/model/loader.py index 7a6e8bbee..7691a8092 100644 --- a/pilot/model/loader.py +++ b/pilot/model/loader.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- import torch -from utils import get_gpu_memory +from pilot.utils import get_gpu_memory from fastchat.serve.inference import compress_module from transformers import ( AutoTokenizer, diff --git a/pilot/server/__init__.py b/pilot/server/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pilot/server/sqlgpt.py b/pilot/server/sqlgpt.py index c55d8e4c0..65966006a 100644 --- a/pilot/server/sqlgpt.py +++ b/pilot/server/sqlgpt.py @@ -1,9 +1,15 @@ #!/usr/bin/env python3 #-*- coding: utf-8 -*- -from model.loader import ModerLoader +from pilot.model.loader import ModerLoader from fastchat.serve.inference import generate_stream -from configs.model_config import * +from pilot.configs.model_config import * if __name__ == "__main__": - pass \ No newline at end of file + + model_path = llm_model_config[LLM_MODEL] + + ml = ModerLoader(model_path) + model, tokenizer = ml.loader(load_8bit=True) + print(model) + print(tokenizer) \ No newline at end of file