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 return_all_tokens & stop_seqs #2584

Merged
merged 6 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
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
fix bug
  • Loading branch information
ming1753 committed Jan 8, 2025
commit c249b98aaae952e76577ff7b396a0808053339ed
1 change: 1 addition & 0 deletions llm/server/server/http_server/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Req(BaseModel):
req_id: str = Field(default_factory=lambda: str(uuid.uuid4()))
input_ids: Optional[List[int]] = None
text: Optional[str] = None
stop_sequences: Optional[List] = None
messages: Optional[List] = None
max_dec_len: Optional[int] = None
seq_len: Optional[int] = None
Expand Down
4 changes: 1 addition & 3 deletions llm/server/server/triton_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ def _cache_special_tokens(self, batch_result):
for i in range(len(batch_result)):
is_end = batch_result[i].get("is_end", 0)
token_ids = batch_result[i]["token_ids"]
return_all_tokens = batch_result[i].get("return_all_tokens", False)
cache_special_token = False if is_end == 1 else True
if is_end != 1 and (cache_special_token or return_all_tokens or self.cfg.disable_streaming):
if is_end != 1:
if batch_result[i]["req_id"] not in self.token_buffer:
self.token_buffer[batch_result[i]["req_id"]] = list()
self.score_buffer[batch_result[i]["req_id"]] = list()
Expand Down