You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rlinf/data/io_struct.py
+59-60Lines changed: 59 additions & 60 deletions
Original file line number
Diff line number
Diff line change
@@ -49,10 +49,10 @@ def get_seq_length(
49
49
classRolloutRequest:
50
50
"""
51
51
Attr
52
-
input_ids: List of input token IDs for rollout
52
+
input_ids: list of input token IDs for rollout
53
53
n: Number of completions to generate for each input
54
54
image_data: list of image data (bytes or URLs) for multimodal inputs
55
-
answers: List of answers for the requests, where each answer can be either a list of strings (for typical tasks) or a dict (for VQA tasks), if available.
55
+
answers: list of answers for the requests, where each answer can be either a list of strings (for typical tasks) or a dict (for VQA tasks), if available.
56
56
multi_modal_inputs: list of multi-modal inputs for the requests
"""Convert the RolloutRequest into a list of SeqGroupInfo objects.
67
67
68
68
Returns:
69
-
List[SeqGroupInfo]: A list of SeqGroupInfo objects.
69
+
list[SeqGroupInfo]: A list of SeqGroupInfo objects.
70
70
"""
71
71
return [
72
72
SeqGroupInfo(
@@ -102,12 +102,12 @@ class SeqGroupInfo:
102
102
103
103
Attributes:
104
104
id (int): Unique identifier for the sequence group.
105
-
input_ids (List[int]): List of input IDs of the original sequence.
106
-
answer (Union[List[str], Dict]): List of answers of the original sequence.(One sequence can have multiple equivalent answers), or a dict in case of vqa task.
105
+
input_ids (list[int]): list of input IDs of the original sequence.
106
+
answer (Union[list[str], dict]): list of answers of the original sequence.(One sequence can have multiple equivalent answers), or a dict in case of vqa task.
107
107
group_size (int): Number of sequences in the group.
108
108
idx_completed (set[int]): Set of indices for sequences that have completed rollout and are ready for evaluation.
109
109
idx_aborted (set[int]): Set of indices for sequences that have been aborted. These sequences need to be re-rolled out before they can be evaluated.
110
-
results (List[Optional[Dict]]): List storing result dictionaries for each sequence, or None if not yet available.
110
+
results (list[Optional[dict]]): list storing result for each sequence, or None if not yet available.
0 commit comments