Spaces:
Sleeping
Sleeping
Download models/transformer/encode_decode/clones.py from Songyou/LLM-fastAPI: direct link, hf CLI and curl.
- Browser
- Download file 162 Bytes
-
https://huggingface.co/spaces/Songyou/LLM-fastAPI/resolve/refs%2Fpr%2F1/models/transformer/encode_decode/clones.py
- Command line
-
hf download hf://spaces/Songyou/LLM-fastAPI@refs/pr/1/models/transformer/encode_decode/clones.py
-
curl -L -o clones.py https://huggingface.co/spaces/Songyou/LLM-fastAPI/resolve/refs%2Fpr%2F1/models/transformer/encode_decode/clones.py
162 Bytes
| import copy | |
| import torch.nn as nn | |
| def clones(module, N): | |
| "Produce N identical layers." | |
| return nn.ModuleList([copy.deepcopy(module) for _ in range(N)]) | |