Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support bloom prefix #2245

Merged
merged 7 commits into from
Oct 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
support bloom prefix
  • Loading branch information
rainyfly committed Oct 13, 2023
commit eecd3fdb3b308cc5ddc6acf85010500fdda22c8c
4 changes: 4 additions & 0 deletions llm/fastdeploy_llm/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,10 @@ def dy_input_preprocess(inputs):
"input_ids"].shape[1]] = paddle.arange(inputs["input_ids"]
.shape[1])
if "bloom" in args.architecture:
tgt_generation_mask[i, :, 0, :max_prefix_len +
length] = paddle.ones(
shape=[1, max_prefix_len + length],
dtype=args.dtype)
arange_tensor_encoder[i, :, :length + max_prefix_len] = paddle.arange(
length + max_prefix_len).astype(args.dtype)
inputs["tgt_pos"] = inputs["tgt_pos"] + max_prefix_len
Expand Down