Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
@@ -26,7 +26,7 @@ class EndpointHandler():
|
|
26 |
while True:
|
27 |
prompt = self.default_template.format(char_name = char_name, user_name = user_name, user_input = "\n".join(user_input))
|
28 |
input_ids = self.tokenizer(prompt + f"\n{char_name}:", return_tensors = "pt").to("cuda")
|
29 |
-
if input_ids.input_ids.size(1)
|
30 |
chats_curled += 1
|
31 |
user_input = user_input[chats_curled*2:]
|
32 |
else: break
|
|
|
26 |
while True:
|
27 |
prompt = self.default_template.format(char_name = char_name, user_name = user_name, user_input = "\n".join(user_input))
|
28 |
input_ids = self.tokenizer(prompt + f"\n{char_name}:", return_tensors = "pt").to("cuda")
|
29 |
+
if input_ids.input_ids.size(1) > 2000:
|
30 |
chats_curled += 1
|
31 |
user_input = user_input[chats_curled*2:]
|
32 |
else: break
|