File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed
server/text_generation_server/models Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change 2
2
import time
3
3
from operator import itemgetter
4
4
5
- import numpy as np
6
5
import torch
7
6
8
7
from dataclasses import dataclass
@@ -163,15 +162,11 @@ def from_pb(
163
162
164
163
# Padded all_input_ids_tensor; the maximum length of any sequence is the max
165
164
# (padded) input sequence length + the max output length
166
- all_input_ids_tensor = np .full (
165
+ all_input_ids_tensor = torch .full (
167
166
(batch_size , tokenize_length + padding_right_offset ),
168
167
tokenizer .pad_token_id ,
169
168
)
170
169
all_input_ids_tensor [:, :all_input_ids .shape [1 ]] = all_input_ids
171
- # Create tensors on device
172
- all_input_ids_tensor = all_input_ids .new_tensor (
173
- all_input_ids_tensor ,
174
- )
175
170
176
171
if prefix_ids :
177
172
# Get input embeddings
You can’t perform that action at this time.
0 commit comments