Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -61,8 +61,7 @@ def generate(
|
|
61 |
|
62 |
### Response:
|
63 |
"""
|
64 |
-
|
65 |
-
inputs = tokenizer(chat, return_tensors="pt", add_special_tokens=False).to("cuda")
|
66 |
if len(inputs) > MAX_INPUT_TOKEN_LENGTH:
|
67 |
inputs = inputs[-MAX_INPUT_TOKEN_LENGTH:]
|
68 |
gr.Warning("Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
|
|
|
61 |
|
62 |
### Response:
|
63 |
"""
|
64 |
+
inputs = tokenizer(prompt, return_tensors="pt", truncation=True).input_ids.cuda()
|
|
|
65 |
if len(inputs) > MAX_INPUT_TOKEN_LENGTH:
|
66 |
inputs = inputs[-MAX_INPUT_TOKEN_LENGTH:]
|
67 |
gr.Warning("Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
|