We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
top_p
top_k
1 parent f0ff4bc commit 5f5cfccCopy full SHA for 5f5cfcc
python/sglang/lang/ir.py
@@ -132,16 +132,11 @@ def to_shortfin_kwargs(self):
132
"temperature": self.temperature,
133
}
134
135
- top_p = self.top_p
136
- if top_p == 1.0:
137
- top_p = None
138
-
139
- top_k = self.top_k
140
- if top_k == -1:
141
- top_k = None
142
143
- kwargs["sampling_params"]["top_p"] = top_p
144
- kwargs["sampling_params"]["top_k"] = top_k
+ top_p, top_k = self.top_p, self.top_k
+ if top_p != 1.0:
+ kwargs["sampling_params"]["top_p"] = top_p
+ if top_k != -1:
+ kwargs["sampling_params"]["top_k"] = top_k
145
146
return kwargs
147
0 commit comments