Skip to content

Commit

Permalink
Check -1 index for vLLM
Browse files Browse the repository at this point in the history
  • Loading branch information
gongy committed Feb 15, 2024
1 parent b03e00c commit 8af8fb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def completion(self, input: str):
t0 = time.time()
index, tokens = 0, 0
async for request_output in results_generator:
if "\ufffd" == request_output.outputs[0].text[-1]:
if request_output.outputs[0].text and "\ufffd" == request_output.outputs[0].text[-1]:
continue
yield request_output.outputs[0].text[index:]
index = len(request_output.outputs[0].text)
Expand Down

0 comments on commit 8af8fb0

Please sign in to comment.