Skip to content

Commit 19734a5

Browse files
authored
fix for CI (#5)
* remove unused import * update * update for 5-4-1 * update * update
1 parent c002f63 commit 19734a5

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ install:
1818

1919
.PHONY: lint
2020
lint: install
21-
uv run ruff check --output-format=github .
21+
uv run ruff check --output-format=github scripts
2222
uv run nbqa ruff notebooks
2323

2424
.PHONY: format
@@ -27,7 +27,7 @@ format: install
2727

2828
.PHONY: typecheck
2929
typecheck: install
30-
uv run mypy .jupytext
30+
uv run mypy scripts
3131
uv run nbqa mypy notebooks
3232

3333
.PHONY: apply-formatter

notebooks/4-2_clip.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@
502502
},
503503
{
504504
"cell_type": "markdown",
505-
"id": "634cf091-dc89-47a4-a7dd-623059b7655f",
505+
"id": "6cf5440f-a7ee-4b38-95eb-5654f5562338",
506506
"metadata": {},
507507
"source": [
508508
"### 画像とテキストのペアの構築"
@@ -519,7 +519,6 @@
519519
"\n",
520520
"import skimage\n",
521521
"from more_itertools import sort_together\n",
522-
"from PIL import Image\n",
523522
"\n",
524523
"original_imgs, original_txts = [], []\n",
525524
"\n",

notebooks/5-4-1_lora.ipynb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@
164164
"cell_type": "code",
165165
"execution_count": 6,
166166
"id": "8d44b56e",
167-
"metadata": {},
167+
"metadata": {
168+
"lines_to_next_cell": 2
169+
},
168170
"outputs": [
169171
{
170172
"data": {
@@ -216,6 +218,11 @@
216218
"metadata": {},
217219
"outputs": [],
218220
"source": [
221+
"import random\n",
222+
"\n",
223+
"import numpy as np\n",
224+
"\n",
225+
"\n",
219226
"def tokenize_captions(examples, is_train=True):\n",
220227
" # Preprocessing the datasets.\n",
221228
" # We need to tokenize input captions and transform the images.\n",

scripts/4-2_clip.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@
148148

149149
import skimage
150150
from more_itertools import sort_together
151-
from PIL import Image
152151

153152
original_imgs, original_txts = [], []
154153

scripts/5-1-1_textual-inversion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def training_function(
354354
)
355355
learning_rate = hparams.learning_rate
356356
max_train_steps = hparams.max_train_steps
357-
output_dir_path = hparams.output_dir_path
357+
# output_dir_path = hparams.output_dir_path
358358
gradient_checkpointing = hparams.gradient_checkpointing
359359

360360
# 学習を効率化する Accelerator の設定
@@ -579,7 +579,7 @@ def training_function(
579579
pipeline.save_pretrained(hparams.output_dir_path)
580580
# 新たに追加した概念に対応するパラメータも保存
581581
save_path = os.path.join(
582-
hparams.output_dir_path, f"learned_embeds.bin"
582+
hparams.output_dir_path, "learned_embeds.bin"
583583
)
584584
save_progress(
585585
text_encoder,

0 commit comments

Comments
 (0)