Quick fix to architecture

This commit is contained in:
Christian Risi
2025-10-08 12:34:09 +02:00
parent 14c3914571
commit c2e13bc9c6
8 changed files with 89 additions and 126 deletions

View File

@@ -9,11 +9,9 @@ class NanoSocratesEmbedder(torch.nn.Module):
super().__init__()
self.__embedder = torch.nn.Embedding(vocabulary_size, embedding_size)
def forward(self, tokenized_sentence: list[list[int]]) -> torch.Tensor:
def forward(self, tokenized_sentence: torch.Tensor) -> torch.Tensor:
TOKENIZED_TENSOR = torch.tensor(tokenized_sentence)
computed_embeddings: torch.Tensor = self.__embedder(TOKENIZED_TENSOR)
computed_embeddings: torch.Tensor = self.__embedder(tokenized_sentence)
_, SENTENCE_LENGHT, EMBEDDING_SIZE = computed_embeddings.shape # for batching