diff --git a/.gitignore b/.gitignore index 51288c78..f3dfe929 100644 --- a/.gitignore +++ b/.gitignore @@ -127,5 +127,10 @@ dmypy.json # Pyre type checker .pyre/ + +# IDE files .idea/ .vscode/ + +# .DS_Store files +.DS_Store diff --git a/llms/llama/convert.py b/llms/llama/convert.py index 618c3070..ec53ba64 100644 --- a/llms/llama/convert.py +++ b/llms/llama/convert.py @@ -60,7 +60,7 @@ def llama(model_path): def tiny_llama(model_path): try: import transformers - except ImportError as e: + except ImportError: print("The transformers package must be installed for this model conversion:") print("pip install transformers") exit(0) diff --git a/llms/llama/llama.py b/llms/llama/llama.py index 74198c89..d684ed6d 100644 --- a/llms/llama/llama.py +++ b/llms/llama/llama.py @@ -5,7 +5,7 @@ import json import time from dataclasses import dataclass from pathlib import Path -from typing import List, Optional, Tuple +from typing import Optional, Tuple import mlx.core as mx import mlx.nn as nn @@ -218,7 +218,6 @@ def toc(msg, start): def generate(args): - input("Press enter to start generation") print("------") print(args.prompt) @@ -347,7 +346,7 @@ if __name__ == "__main__": parser = argparse.ArgumentParser(description="Llama inference script") parser.add_argument( "--model-path", - help="Path to the model directory containing the MLX weights", + help="Path to the model weights and tokenizer", default="mlx_model", ) parser.add_argument( diff --git a/llms/mixtral/mixtral.py b/llms/mixtral/mixtral.py index 30fa8d8b..8f715180 100644 --- a/llms/mixtral/mixtral.py +++ b/llms/mixtral/mixtral.py @@ -9,7 +9,6 @@ from typing import List, Optional, Tuple import mlx.core as mx import mlx.nn as nn -import numpy as np from mlx.utils import tree_map, tree_unflatten from sentencepiece import SentencePieceProcessor