Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -59,7 +59,7 @@ def generate(
|
|
59 |
conversation.append({"role": "user", "content": message})
|
60 |
|
61 |
inputs = tokenizer.apply_chat_template(conversation, tokenize=False)
|
62 |
-
|
63 |
|
64 |
# input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
|
65 |
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
|
|
|
59 |
conversation.append({"role": "user", "content": message})
|
60 |
|
61 |
inputs = tokenizer.apply_chat_template(conversation, tokenize=False)
|
62 |
+
input_ids = tokenizer(inputs, return_tensors='pt', return_token_type_ids=False).input_ids
|
63 |
|
64 |
# input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
|
65 |
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
|