init model and tokenizer

This commit is contained in:
csunny 2023-04-28 22:18:08 +08:00
parent c72ae1a87f
commit 0861a09a00
6 changed files with 15 additions and 4 deletions

3
pilot/__init__.py Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__version__ = "0.0.1"

2
pilot/model/__init__.py Normal file
View File

@ -0,0 +1,2 @@
from model.loader import *

View File

@ -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,

0
pilot/server/__init__.py Normal file
View File

View File

@ -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
model_path = llm_model_config[LLM_MODEL]
ml = ModerLoader(model_path)
model, tokenizer = ml.loader(load_8bit=True)
print(model)
print(tokenizer)