Pierce Maloney
commited on
Commit
•
8cda5e7
1
Parent(s):
b179918
taking out truncation of input_ids
Browse files- handler.py +4 -4
handler.py
CHANGED
@@ -31,11 +31,11 @@ class EndpointHandler():
|
|
31 |
|
32 |
input_ids = self.tokenizer.encode(inputs, return_tensors="pt").to('cuda')
|
33 |
max_generation_length = 75 # Desired number of tokens to generate
|
34 |
-
max_input_length = 4092 - max_generation_length # Maximum input length to allow space for generation
|
35 |
|
36 |
-
# Truncate input_ids to the most recent tokens that fit within the max_input_length
|
37 |
-
if input_ids.shape[1] > max_input_length:
|
38 |
-
|
39 |
|
40 |
max_length = input_ids.shape[1] + max_generation_length
|
41 |
|
|
|
31 |
|
32 |
input_ids = self.tokenizer.encode(inputs, return_tensors="pt").to('cuda')
|
33 |
max_generation_length = 75 # Desired number of tokens to generate
|
34 |
+
# max_input_length = 4092 - max_generation_length # Maximum input length to allow space for generation
|
35 |
|
36 |
+
# # Truncate input_ids to the most recent tokens that fit within the max_input_length
|
37 |
+
# if input_ids.shape[1] > max_input_length:
|
38 |
+
# input_ids = input_ids[:, -max_input_length:]
|
39 |
|
40 |
max_length = input_ids.shape[1] + max_generation_length
|
41 |
|