mirror of
https://github.com/pese-git/llm-arch-research.git
synced 2026-01-23 21:10:54 +00:00
Рефакторинг: единообразие оформления кода (пробелы, кавычки, пустые строки), без изменения логики по всему проекту.
This commit is contained in:
@@ -58,7 +58,7 @@ def gpt_config(vocab_size, embed_dim, num_heads, num_layers):
|
||||
"num_heads": num_heads,
|
||||
"num_layers": num_layers,
|
||||
"max_position_embeddings": 1024,
|
||||
"dropout": 0.1
|
||||
"dropout": 0.1,
|
||||
}
|
||||
|
||||
|
||||
@@ -68,12 +68,14 @@ def random_inputs(batch_size, seq_len, vocab_size):
|
||||
input_ids = torch.randint(0, vocab_size, (batch_size, seq_len))
|
||||
return input_ids
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def random_float_inputs(batch_size, seq_len, embed_dim):
|
||||
"""Generate random floating point input tensors for testing feed forward."""
|
||||
inputs = torch.randn(batch_size, seq_len, embed_dim)
|
||||
return inputs
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def random_embeddings(batch_size, seq_len, embed_dim):
|
||||
"""Generate random embedding tensors for testing attention modules."""
|
||||
|
||||
Reference in New Issue
Block a user