Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
e615cfc3
Unverified
Commit
e615cfc3
authored
Sep 08, 2022
by
アマデウス
Committed by
GitHub
Sep 08, 2022
Browse files
[NFC] polish test component gpt code style (#1567)
parent
6159d454
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
tests/components_to_test/gpt.py
tests/components_to_test/gpt.py
+8
-1
No files found.
tests/components_to_test/gpt.py
View file @
e615cfc3
...
...
@@ -47,8 +47,15 @@ class GPTLMModel(nn.Module):
# Only return lm_logits
return
self
.
model
(
input_ids
=
input_ids
,
attention_mask
=
attention_mask
,
use_cache
=
not
self
.
checkpoint
)[
0
]
def
gpt2_micro
(
checkpoint
=
True
):
return
GPTLMModel
(
checkpoint
=
checkpoint
,
hidden_size
=
32
,
num_layers
=
2
,
num_attention_heads
=
4
,
max_seq_len
=
64
,
vocab_size
=
128
)
return
GPTLMModel
(
checkpoint
=
checkpoint
,
hidden_size
=
32
,
num_layers
=
2
,
num_attention_heads
=
4
,
max_seq_len
=
64
,
vocab_size
=
128
)
def
gpt2_s
(
checkpoint
=
True
):
return
GPTLMModel
(
checkpoint
=
checkpoint
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment