aaabiao commited on
Commit
f7ae4a1
·
verified ·
1 Parent(s): 48548d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -37,7 +37,7 @@ def generate(
37
  input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
38
  if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
39
  input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
40
- gr.Warning(f"Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
41
  input_ids = input_ids.to(model.device)
42
 
43
  streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
 
37
  input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
38
  if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
39
  input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
40
+ gr.Warning(f"Trimmed input from conversation as it was longer than {str(MAX_INPUT_TOKEN_LENGTH)} tokens.")
41
  input_ids = input_ids.to(model.device)
42
 
43
  streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)