Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def generate(message, chat_history, max_new_tokens):
|
|
34 |
final_prompt += "User: " + message + "\n"
|
35 |
final_prompt += "Output:"
|
36 |
|
37 |
-
if len(tokenizer.tokenize(final_prompt)) >=
|
38 |
final_prompt = "Instruction: Say 'Input exceeded context size, please clear the chat history and retry!' Output:"
|
39 |
|
40 |
# Streamer
|
|
|
34 |
final_prompt += "User: " + message + "\n"
|
35 |
final_prompt += "Output:"
|
36 |
|
37 |
+
if len(tokenizer.tokenize(final_prompt)) >= 512 - max_new_tokens:
|
38 |
final_prompt = "Instruction: Say 'Input exceeded context size, please clear the chat history and retry!' Output:"
|
39 |
|
40 |
# Streamer
|