Spaces:
Running
on
Zero
Running
on
Zero
Update model.py
Browse filesMake sure not to add bos twice
model.py
CHANGED
@@ -33,7 +33,7 @@ def get_prompt(message: str, chat_history: list[tuple[str, str]],
|
|
33 |
|
34 |
def get_input_token_length(message: str, chat_history: list[tuple[str, str]], system_prompt: str) -> int:
|
35 |
prompt = get_prompt(message, chat_history, system_prompt)
|
36 |
-
input_ids = tokenizer([prompt], return_tensors='np')['input_ids']
|
37 |
return input_ids.shape[-1]
|
38 |
|
39 |
|
|
|
33 |
|
34 |
def get_input_token_length(message: str, chat_history: list[tuple[str, str]], system_prompt: str) -> int:
|
35 |
prompt = get_prompt(message, chat_history, system_prompt)
|
36 |
+
input_ids = tokenizer([prompt], return_tensors='np', add_special_tokens = False)['input_ids']
|
37 |
return input_ids.shape[-1]
|
38 |
|
39 |
|