e2k 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {e2k-0.2.1/src/e2k.egg-info → e2k-0.2.2}/PKG-INFO +1 -1
- {e2k-0.2.1 → e2k-0.2.2}/pyproject.toml +1 -1
- {e2k-0.2.1 → e2k-0.2.2}/src/e2k/inference.py +5 -0
- {e2k-0.2.1 → e2k-0.2.2/src/e2k.egg-info}/PKG-INFO +1 -1
- {e2k-0.2.1 → e2k-0.2.2}/LICENSE +0 -0
- {e2k-0.2.1 → e2k-0.2.2}/README.md +0 -0
- {e2k-0.2.1 → e2k-0.2.2}/setup.cfg +0 -0
- {e2k-0.2.1 → e2k-0.2.2}/src/e2k/__init__.py +0 -0
- {e2k-0.2.1 → e2k-0.2.2}/src/e2k/constants.py +0 -0
- {e2k-0.2.1 → e2k-0.2.2}/src/e2k/models/model-c2k.npz +0 -0
- {e2k-0.2.1 → e2k-0.2.2}/src/e2k/models/model-p2k.npz +0 -0
- {e2k-0.2.1 → e2k-0.2.2}/src/e2k.egg-info/SOURCES.txt +0 -0
- {e2k-0.2.1 → e2k-0.2.2}/src/e2k.egg-info/dependency_links.txt +0 -0
- {e2k-0.2.1 → e2k-0.2.2}/src/e2k.egg-info/requires.txt +0 -0
- {e2k-0.2.1 → e2k-0.2.2}/src/e2k.egg-info/top_level.txt +0 -0
|
@@ -140,6 +140,11 @@ class MHA:
|
|
|
140
140
|
|
|
141
141
|
class S2S:
|
|
142
142
|
def __init__(self, weights: Dict[str, np.ndarray], max_len: int = 16):
|
|
143
|
+
# fp32 is usually faster than fp16 on CPU
|
|
144
|
+
new_weight = {}
|
|
145
|
+
for k, v in weights.items():
|
|
146
|
+
new_weight[k] = v.astype(np.float32)
|
|
147
|
+
weights = new_weight
|
|
143
148
|
self.e_emb = Embedding(weights["e_emb.weight"])
|
|
144
149
|
self.k_emb = Embedding(weights["k_emb.weight"])
|
|
145
150
|
self.encoder = GRU(
|
{e2k-0.2.1 → e2k-0.2.2}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|