introduce pre-commit typos check

This commit is contained in:
Anthony Wu 2024-10-09 14:20:49 -07:00
parent f4d0bc799d
commit 19867d5bb7
6 changed files with 14 additions and 5 deletions

View File

@ -1,7 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.6
rev: v0.6.9
hooks:
# Run the linter.
- id: ruff
@ -10,3 +10,7 @@ repos:
# Run the formatter.
- id: ruff-format
types_or: [python, pyi]
- repo: https://github.com/crate-ci/typos
rev: v1.26.0
hooks:
- id: typos

5
_typos.toml Normal file
View File

@ -0,0 +1,5 @@
# this is the config file for typos-cli, part of "pre-commit run"
# use "typos --dump-config" to disocver other configs to override
[default]
extend-ignore-identifiers-re = ["EmbedND", "embed_nd", "alle"]

View File

@ -118,7 +118,7 @@ class Flux1Controlnet:
config = RuntimeConfig(config, self.model_config)
time_steps = tqdm(range(config.num_inference_steps))
# Embedd the controlnet reference image
# Embed the controlnet reference image
control_image = ImageUtil.load_image(controlnet_image_path)
control_image = ControlnetUtil.scale_image(config.height, config.width, control_image)
control_image = ControlnetUtil.preprocess_canny(control_image)
@ -135,7 +135,7 @@ class Flux1Controlnet:
key=mx.random.key(seed)
) # fmt: off
# 2. Embedd the prompt
# 2. Embed the prompt
t5_tokens = self.t5_tokenizer.tokenize(prompt)
clip_tokens = self.clip_tokenizer.tokenize(prompt)
prompt_embeds = self.t5_text_encoder.forward(t5_tokens)

View File

@ -82,7 +82,7 @@ class Flux1:
key=mx.random.key(seed)
) # fmt: off
# 2. Embedd the prompt
# 2. Embed the prompt
t5_tokens = self.t5_tokenizer.tokenize(prompt)
clip_tokens = self.clip_tokenizer.tokenize(prompt)
prompt_embeds = self.t5_text_encoder.forward(t5_tokens)

View File

@ -5,7 +5,7 @@ from mlx import nn
from mflux.config.model_config import ModelConfig
from mflux.config.runtime_config import RuntimeConfig
from mflux.models.transformer.ada_layer_norm_continous import (
from mflux.models.transformer.ada_layer_norm_continuous import (
AdaLayerNormContinuous,
)
from mflux.models.transformer.embed_nd import EmbedND