[FIX] Explain why the finished_reason of ignored sequences are length (#1289)

This commit is contained in:
Zhuohan Li
2023-10-08 15:22:38 -07:00
committed by GitHub
parent ee92b58b3a
commit 6b5296aa3a

View File

@ -35,6 +35,9 @@ class SequenceStatus(enum.Enum):
elif status == SequenceStatus.FINISHED_ABORTED:
finish_reason = "abort"
elif status == SequenceStatus.FINISHED_IGNORED:
# The ignored sequences are the sequences whose prompt lengths
# are longer than the model's length cap. Therefore, the stop
# reason should also be "length" as in OpenAI API.
finish_reason = "length"
else:
finish_reason = None