Fix
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def generate(
|
|
42 |
input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
|
43 |
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
|
44 |
input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
|
45 |
-
gr.Warning("Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
|
46 |
input_ids = input_ids.to(model.device)
|
47 |
|
48 |
streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
|
|
|
42 |
input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
|
43 |
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
|
44 |
input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
|
45 |
+
gr.Warning(f"Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
|
46 |
input_ids = input_ids.to(model.device)
|
47 |
|
48 |
streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
|