[Minor] Add some utility functions (#1671)
This commit is contained in:
@@ -202,3 +202,14 @@ class SamplingBatchInfo:
|
||||
self.logit_bias = SamplingBatchInfo.merge_bias_tensor(
|
||||
self.logit_bias, other.logit_bias, len(self), len(other), self.device
|
||||
)
|
||||
|
||||
def copy(self):
|
||||
return SamplingBatchInfo(
|
||||
temperatures=self.temperatures,
|
||||
top_ps=self.top_ps,
|
||||
top_ks=self.top_ks,
|
||||
min_ps=self.min_ps,
|
||||
need_min_p_sampling=self.need_min_p_sampling,
|
||||
vocab_size=self.vocab_size,
|
||||
device=self.device,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user