Skip to content

Commit 7d7e236

Browse files
authored
- Removed unused Python imports (ml-explore#683)
- bert/model.py:10: tree_unflatten - bert/model.py:2: dataclass - bert/model.py:8: numpy - cifar/resnet.py:6: Any - clip/model.py:15: tree_flatten - clip/model.py:9: Union - gcn/main.py:8: download_cora - gcn/main.py:9: cross_entropy - llms/gguf_llm/models.py:12: tree_flatten, tree_unflatten - llms/gguf_llm/models.py:9: numpy - llms/mixtral/mixtral.py:12: tree_map - llms/mlx_lm/models/dbrx.py:2: Dict, Union - llms/mlx_lm/tuner/trainer.py:5: partial - llms/speculative_decoding/decoder.py:1: dataclass, field - llms/speculative_decoding/decoder.py:2: Optional - llms/speculative_decoding/decoder.py:5: mlx.nn - llms/speculative_decoding/decoder.py:6: numpy - llms/speculative_decoding/main.py:2: glob - llms/speculative_decoding/main.py:3: json - llms/speculative_decoding/main.py:5: Path - llms/speculative_decoding/main.py:8: mlx.nn - llms/speculative_decoding/model.py:6: tree_unflatten - llms/speculative_decoding/model.py:7: AutoTokenizer - llms/tests/test_lora.py:13: yaml_loader - lora/lora.py:14: tree_unflatten - lora/models.py:11: numpy - lora/models.py:3: glob - speechcommands/kwt.py:1: Any - speechcommands/main.py:7: mlx.data - stable_diffusion/stable_diffusion/model_io.py:4: partial - whisper/benchmark.py:5: sys - whisper/test.py:5: subprocess - whisper/whisper/audio.py:6: Optional - whisper/whisper/decoding.py:8: mlx.nn
1 parent e55a9e8 commit 7d7e236

File tree

21 files changed

+9
-36
lines changed

21 files changed

+9
-36
lines changed

bert/model.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import argparse
2-
from dataclasses import dataclass
32
from pathlib import Path
43
from typing import List, Optional, Tuple
54

65
import mlx.core as mx
76
import mlx.nn as nn
8-
import numpy
9-
import numpy as np
107
from mlx.utils import tree_unflatten
118
from transformers import AutoConfig, AutoTokenizer, PreTrainedTokenizerBase
129

cifar/resnet.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
Configurations include ResNet-20, ResNet-32, ResNet-44, ResNet-56, ResNet-110, ResNet-1202.
44
"""
55

6-
from typing import Any
7-
86
import mlx.core as mx
97
import mlx.nn as nn
108
from mlx.utils import tree_flatten

clip/model.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
import math
77
from dataclasses import dataclass
88
from pathlib import Path
9-
from typing import Optional, Union
9+
from typing import Optional
1010

1111
import mlx.core as mx
1212
import mlx.nn as nn
1313
from mlx.core import linalg as LA
1414
from mlx.nn.losses import cross_entropy
15-
from mlx.utils import tree_flatten
1615

1716

1817
@dataclass

gcn/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
import mlx.core as mx
66
import mlx.nn as nn
77
import mlx.optimizers as optim
8-
from datasets import download_cora, load_data, train_val_test_mask
9-
from mlx.nn.losses import cross_entropy
8+
from datasets import load_data, train_val_test_mask
109
from mlx.utils import tree_flatten
1110

1211
from gcn import GCN

llms/gguf_llm/models.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66

77
import mlx.core as mx
88
import mlx.nn as nn
9-
import numpy as np
109
import utils
1110
from huggingface_hub import snapshot_download
12-
from mlx.utils import tree_flatten, tree_unflatten
1311

1412

1513
@dataclass

llms/mixtral/mixtral.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import mlx.core as mx
1111
import mlx.nn as nn
12-
from mlx.utils import tree_map, tree_unflatten
12+
from mlx.utils import tree_unflatten
1313
from sentencepiece import SentencePieceProcessor
1414

1515

llms/mlx_lm/models/dbrx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dataclasses import dataclass
2-
from typing import Dict, Optional, Tuple, Union
2+
from typing import Optional, Tuple
33

44
import mlx.core as mx
55
import mlx.nn as nn

llms/mlx_lm/tuner/trainer.py

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

33
import time
44
from dataclasses import dataclass, field
5-
from functools import partial
65
from pathlib import Path
76
from typing import Union
87

llms/speculative_decoding/decoder.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
from dataclasses import dataclass, field
2-
from typing import List, Optional
1+
from typing import List
32

43
import mlx.core as mx
5-
import mlx.nn as nn
6-
import numpy as np
74
import transformers
85
from model import Model
96

llms/speculative_decoding/main.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import argparse
2-
import glob
3-
import json
42
import time
5-
from pathlib import Path
63

74
import mlx.core as mx
8-
import mlx.nn as nn
95
from decoder import SpeculativeDecoder
106
from mlx.utils import tree_unflatten
117
from model import Model

0 commit comments

Comments
 (0)