MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / add_code_generation_args

Function add_code_generation_args

tests/test_inference_megatron.py:36–133  ·  view source on GitHub ↗

Code generation arguments.

(parser)

Source from the content-addressed store, hash-verified

34
35
36def add_code_generation_args(parser):
37 """Code generation arguments."""
38 group = parser.add_argument_group(title="code generation")
39
40 group.add_argument(
41 "--temperature",
42 type=float,
43 default=1.0,
44 help="Sampling temperature.",
45 )
46 group.add_argument(
47 "--greedy",
48 action="store_true",
49 default=False,
50 help="Use greedy sampling.",
51 )
52 group.add_argument(
53 "--top-p",
54 type=float,
55 default=0.0,
56 help="Top p sampling.",
57 )
58 group.add_argument(
59 "--top-k",
60 type=int,
61 default=0,
62 help="Top k sampling.",
63 )
64 group.add_argument(
65 "--out-seq-length",
66 type=int,
67 default=2048,
68 help="Size of the output generated text.",
69 )
70 group.add_argument(
71 "--recompute",
72 action="store_true",
73 help="During generation recompute all attention "
74 "instead of using previously computed keys/values.",
75 )
76 group.add_argument(
77 "--ws-encoding-start-id",
78 type=int,
79 default=10,
80 help="Start id for whitespace encoding",
81 )
82 group.add_argument(
83 "--ws-encoding-length",
84 type=int,
85 default=10,
86 help="Length of whitespace encoding",
87 )
88 group.add_argument(
89 "--n-generation",
90 type=int,
91 default=10,
92 )
93 group.add_argument(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected