Update ts_generation_mixin.py
Browse files- ts_generation_mixin.py +1 -1
ts_generation_mixin.py
CHANGED
@@ -26,6 +26,7 @@ class TSGenerationMixin(GenerationMixin):
|
|
26 |
**model_kwargs,
|
27 |
) -> Union[GenerateNonBeamOutput, torch.Tensor]:
|
28 |
input_ids = input_ids.to(self.device)
|
|
|
29 |
if len(input_ids.shape) == 2:
|
30 |
batch_size, cur_len = input_ids.shape
|
31 |
if cur_len < self.config.input_token_len:
|
@@ -37,7 +38,6 @@ class TSGenerationMixin(GenerationMixin):
|
|
37 |
input_ids = input_ids[:, -new_len:]
|
38 |
else:
|
39 |
raise ValueError('Input shape must be: [batch_size, seq_len]')
|
40 |
-
initial_input_length = input_ids.shape[1]
|
41 |
|
42 |
# init values
|
43 |
logits_processor = logits_processor if logits_processor is not None else LogitsProcessorList()
|
|
|
26 |
**model_kwargs,
|
27 |
) -> Union[GenerateNonBeamOutput, torch.Tensor]:
|
28 |
input_ids = input_ids.to(self.device)
|
29 |
+
initial_input_length = input_ids.shape[1]
|
30 |
if len(input_ids.shape) == 2:
|
31 |
batch_size, cur_len = input_ids.shape
|
32 |
if cur_len < self.config.input_token_len:
|
|
|
38 |
input_ids = input_ids[:, -new_len:]
|
39 |
else:
|
40 |
raise ValueError('Input shape must be: [batch_size, seq_len]')
|
|
|
41 |
|
42 |
# init values
|
43 |
logits_processor = logits_processor if logits_processor is not None else LogitsProcessorList()
|