Skip to content

Commit c594335

Browse files
Merge pull request #588 from Butanium/fix/prepare-input-typing
fix(typing): correct _prepare_input type annotations in LanguageModel
2 parents ed49406 + 6701f0d commit c594335

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/nnsight/modeling/language.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -207,26 +207,24 @@ def _tokenize(
207207

208208
def _prepare_input(
209209
self,
210-
*inputs: Tuple[
211-
Union[
212-
str,
213-
List[str],
214-
List[List[str]],
215-
List[int],
216-
List[List[int]],
217-
torch.Tensor,
218-
List[torch.Tensor],
219-
Dict[str, Any],
220-
BatchEncoding,
221-
]
210+
*inputs: Union[
211+
str,
212+
List[str],
213+
List[List[str]],
214+
List[int],
215+
List[List[int]],
216+
torch.Tensor,
217+
List[torch.Tensor],
218+
Dict[str, Any],
219+
BatchEncoding,
222220
],
223221
input_ids: Union[
224222
List[int], List[List[int]], torch.Tensor, List[torch.Tensor]
225223
] = None,
226224
labels: Any = None,
227225
attention_mask: Any = None,
228226
**kwargs,
229-
) -> Tuple[BatchEncoding, int]:
227+
) -> Tuple[Tuple[()], Dict[str, Any]]:
230228

231229
if input_ids is not None:
232230

0 commit comments

Comments
 (0)