(args)
| 91 | |
| 92 | |
| 93 | def main(args): |
| 94 | if args.style == "simple": |
| 95 | chatio = SimpleChatIO() |
| 96 | elif args.style == "rich": |
| 97 | chatio = RichChatIO() |
| 98 | else: |
| 99 | raise ValueError(f"Invalid style for console: {args.style}") |
| 100 | try: |
| 101 | assert not (args.load_8bit and args.load_4bit), "Int8 is not compatible with Int4." |
| 102 | chat_loop( |
| 103 | args.model_path, |
| 104 | args.device, |
| 105 | args.num_gpus, |
| 106 | args.max_gpu_memory, |
| 107 | args.load_8bit, |
| 108 | args.load_4bit, |
| 109 | args.conv_template, |
| 110 | args.temperature, |
| 111 | args.max_new_tokens, |
| 112 | chatio, |
| 113 | args.debug, |
| 114 | ) |
| 115 | except KeyboardInterrupt: |
| 116 | print("exit...") |
| 117 | |
| 118 | |
| 119 | if __name__ == "__main__": |
no test coverage detected