full codespell coverage

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2026-06-04 12:36:10 +02:00
parent 0bfcdabbbb
commit 5e99dee3c2
103 changed files with 264 additions and 254 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ class Mlp(nn.Module):
x = self.fc1(x)
x = self.act(x)
# x = self.drop(x)
# commit this for the orignal BERT implement
# commit this for the original BERT implement
x = self.ffn_ln(x)
x = self.fc2(x)
+3 -3
View File
@@ -4,7 +4,7 @@ from torch import nn
from einops import rearrange, repeat
import logging
def broadcat(tensors, dim = -1):
def broadcast(tensors, dim = -1):
num_tensors = len(tensors)
shape_lens = set(map(lambda t: len(t.shape), tensors))
assert len(shape_lens) == 1, 'tensors must all have the same number of dimensions'
@@ -60,7 +60,7 @@ class VisionRotaryEmbedding(nn.Module):
freqs_w = torch.einsum('..., f -> ... f', t, freqs)
freqs_w = repeat(freqs_w, '... n -> ... (n r)', r = 2)
freqs = broadcat((freqs_h[:, None, :], freqs_w[None, :, :]), dim = -1)
freqs = broadcast((freqs_h[:, None, :], freqs_w[None, :, :]), dim = -1)
self.register_buffer("freqs_cos", freqs.cos())
self.register_buffer("freqs_sin", freqs.sin())
@@ -106,7 +106,7 @@ class VisionRotaryEmbeddingFast(nn.Module):
freqs = torch.einsum('..., f -> ... f', t, freqs)
freqs = repeat(freqs, '... n -> ... (n r)', r = 2)
freqs = broadcat((freqs[:, None, :], freqs[None, :, :]), dim = -1)
freqs = broadcast((freqs[:, None, :], freqs[None, :, :]), dim = -1)
freqs_cos = freqs.cos().view(-1, freqs.shape[-1])
freqs_sin = freqs.sin().view(-1, freqs.shape[-1])
+1 -1
View File
@@ -27,7 +27,7 @@ def bytes_to_unicode():
The reversible bpe codes work on unicode strings.
This means you need a large # of unicode characters in your vocab if you want to avoid UNKs.
When you're at something like a 10B token dataset you end up needing around 5K for decent coverage.
This is a signficant percentage of your normal, say, 32K bpe vocab.
This is a significant percentage of your normal, say, 32K bpe vocab.
To avoid that, we want lookup tables between utf-8 bytes and unicode strings.
And avoids mapping to whitespace/control characters the bpe code barfs on.
"""
+1 -1
View File
@@ -229,7 +229,7 @@ class StableDiffusionXLPuLIDPipeline:
if len(self.face_helper.cropped_faces) == 0:
raise RuntimeError('facexlib align face fail')
align_face = self.face_helper.cropped_faces[0]
# incase insightface didn't detect face
# in case insightface didn't detect face
if id_ante_embedding is None:
id_ante_embedding = self.handler_ante.get_feat(align_face)