Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Shape Transformer RWKV
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolay Strohschen
Shape Transformer RWKV
Commits
68aed754
Commit
68aed754
authored
3 years ago
by
Gregor Kobsik
Browse files
Options
Downloads
Patches
Plain Diff
include `pytorch-fast-transformers` as an optional module
parent
467ca569
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/architecture/architecture_factory.py
+4
-2
4 additions, 2 deletions
modules/architecture/architecture_factory.py
with
4 additions
and
2 deletions
modules/architecture/architecture_factory.py
+
4
−
2
View file @
68aed754
from
.autoencoder
import
Autoencoder
from
.transformer
import
Transformer
from
.pytorch_transformer
import
PytorchTransformer
from
.fast_transformer
import
FastTransformer
from
.fast_recurrent_transformer
import
FastRecurrentTransformer
def
create_architecture
(
...
...
@@ -61,8 +59,12 @@ def create_architecture(
elif
architecture
==
"
pytorch
"
:
return
PytorchTransformer
(
**
kwargs
)
elif
architecture
==
"
fast
"
:
# include `pytorch-fast-transformers` as an optional module
from
.fast_transformer
import
FastTransformer
return
FastTransformer
(
**
kwargs
)
elif
architecture
==
"
fast-recurrent
"
:
# include `pytorch-fast-transformers` as an optional module
from
.fast_recurrent_transformer
import
FastRecurrentTransformer
return
FastRecurrentTransformer
(
**
kwargs
)
else
:
raise
ValueError
(
f
"
ERROR:
{
attention
}
_
{
architecture
}
transformer architecture not implemented.
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment