Update app.py
Browse files
app.py
CHANGED
|
@@ -42,8 +42,7 @@ def generate(message, chat_history, max_new_tokens):
|
|
| 42 |
final_prompt += "Output:"
|
| 43 |
|
| 44 |
if (
|
| 45 |
-
len(tokenizer.tokenize(final_prompt))
|
| 46 |
-
>= tokenizer.model_max_length - max_new_tokens
|
| 47 |
):
|
| 48 |
final_prompt = "Instruction: Say 'Input exceeded context size, please clear the chat history and retry!' Output:"
|
| 49 |
|
|
|
|
| 42 |
final_prompt += "Output:"
|
| 43 |
|
| 44 |
if (
|
| 45 |
+
len(tokenizer.tokenize(final_prompt)) >= tokenizer.model_max_length - max_new_tokens
|
|
|
|
| 46 |
):
|
| 47 |
final_prompt = "Instruction: Say 'Input exceeded context size, please clear the chat history and retry!' Output:"
|
| 48 |
|