()
| 14 | sys.exit(1) |
| 15 | |
| 16 | def run_inference(): |
| 17 | build_dir = "build" |
| 18 | if platform.system() == "Windows": |
| 19 | main_path = os.path.join(build_dir, "bin", "Release", "llama-cli.exe") |
| 20 | if not os.path.exists(main_path): |
| 21 | main_path = os.path.join(build_dir, "bin", "llama-cli") |
| 22 | else: |
| 23 | main_path = os.path.join(build_dir, "bin", "llama-cli") |
| 24 | command = [ |
| 25 | f'{main_path}', |
| 26 | '-m', args.model, |
| 27 | '-n', str(args.n_predict), |
| 28 | '-t', str(args.threads), |
| 29 | '-p', args.prompt, |
| 30 | '-ngl', '0', |
| 31 | '-c', str(args.ctx_size), |
| 32 | '--temp', str(args.temperature), |
| 33 | "-b", "1", |
| 34 | ] |
| 35 | if args.conversation: |
| 36 | command.append("-cnv") |
| 37 | run_command(command) |
| 38 | |
| 39 | def signal_handler(sig, frame): |
| 40 | print("Ctrl+C pressed, exiting...") |
no test coverage detected