MCPcopy Create free account
hub / github.com/microsoft/BitNet / run_inference

Function run_inference

run_inference.py:16–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14 sys.exit(1)
15
16def 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
39def signal_handler(sig, frame):
40 print("Ctrl+C pressed, exiting...")

Callers 1

run_inference.pyFile · 0.85

Calls 1

run_commandFunction · 0.70

Tested by

no test coverage detected