Spaces:
Runtime error
Runtime error
Update model.py (#7)
Browse files- Update model.py (0e03aec07d9b55e5857eaa7c9586923573485280)
Co-authored-by: Arthur Zucker <[email protected]>
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 |
|