MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / gpt_params_parse

Function gpt_params_parse

examples/low_level_api/common.py:77–386  ·  view source on GitHub ↗
(argv=None)

Source from the content-addressed store, hash-verified

75
76
77def gpt_params_parse(argv=None):
78 parser = argparse.ArgumentParser(
79 formatter_class=argparse.ArgumentDefaultsHelpFormatter
80 )
81 parser.add_argument(
82 "-s",
83 "--seed",
84 type=int,
85 default=-1,
86 help="RNG seed (use random seed for <= 0)",
87 dest="seed",
88 )
89 parser.add_argument(
90 "-t",
91 "--threads",
92 type=int,
93 default=min(4, os.cpu_count() or 1),
94 help="number of threads to use during computation",
95 dest="n_threads",
96 )
97 parser.add_argument(
98 "-n",
99 "--n_predict",
100 type=int,
101 default=128,
102 help="number of tokens to predict (-1 = infinity)",
103 dest="n_predict",
104 )
105 parser.add_argument(
106 "--n_parts", type=int, default=-1, help="number of model parts", dest="n_parts"
107 )
108 parser.add_argument(
109 "-c",
110 "--ctx_size",
111 type=int,
112 default=512,
113 help="size of the prompt context",
114 dest="n_ctx",
115 )
116 parser.add_argument(
117 "-b",
118 "--batch_size",
119 type=int,
120 default=8,
121 help="batch size for prompt processing",
122 dest="n_batch",
123 )
124 parser.add_argument(
125 "--keep",
126 type=int,
127 default=0,
128 help="number of tokens to keep from the initial prompt",
129 dest="n_keep",
130 )
131
132 parser.add_argument(
133 "-l",
134 "--logit-bias",

Callers 2

common.pyFile · 0.85

Calls 1

GptParamsClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…