-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
27 lines (18 loc) · 806 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import fire
from llama2gptq.ingest import ingest
from llama2gptq.qa import chat_cli
from llama2gptq.quantize import quantization
from constants import (SOURCE_DIRECTORY, PERSIST_DIRECTORY)
def chat(device: str = "cuda") -> str:
stats = chat_cli(device)
return stats
def process(src_dir: str = SOURCE_DIRECTORY, dst_dir: str = PERSIST_DIRECTORY, device: str = "cuda") -> str:
return ingest(src_dir, dst_dir, device)
def quantize(model: str = "meta-llama/Llama-2-13b-chat-hf",
output: str = "llama-2-13b-chat-hf-gptq",
push: bool = False, owner: str = 'seonglae',
safetensor = False, inference_only: bool = False) -> str:
quantization(model, output, push, owner, safetensor, inference_only)
return 'complete'
if __name__ == '__main__':
fire.Fire()