mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-10-23 05:58:07 +08:00
Add llms subdir + update README (#145)
* add llms subdir + update README * nits * use same pre-commit as mlx * update readmes a bit * format
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import numpy as np
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import os
|
||||
import torch
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(
|
||||
|
@@ -32,8 +32,8 @@ class WikiSQL:
|
||||
def _maybe_download(self, data_dir):
|
||||
if not os.path.exists(data_dir):
|
||||
import io
|
||||
from urllib import request
|
||||
import tarfile
|
||||
from urllib import request
|
||||
|
||||
url = "https://raw.githubusercontent.com/salesforce/WikiSQL/master/data.tar.bz2"
|
||||
r = request.urlopen(url)
|
||||
|
14
lora/lora.py
14
lora/lora.py
@@ -3,19 +3,17 @@
|
||||
import argparse
|
||||
import json
|
||||
import math
|
||||
import numpy as np
|
||||
from pathlib import Path
|
||||
from sentencepiece import SentencePieceProcessor
|
||||
import time
|
||||
from typing import Optional, Tuple, List
|
||||
from pathlib import Path
|
||||
from typing import List, Optional, Tuple
|
||||
|
||||
import mlx.core as mx
|
||||
import mlx.nn as nn
|
||||
import mlx.optimizers as optim
|
||||
from mlx.utils import tree_map, tree_flatten, tree_unflatten
|
||||
|
||||
|
||||
from models import ModelArgs, Model, LoRALinear
|
||||
import numpy as np
|
||||
from mlx.utils import tree_flatten, tree_map, tree_unflatten
|
||||
from models import LoRALinear, Model, ModelArgs
|
||||
from sentencepiece import SentencePieceProcessor
|
||||
|
||||
|
||||
def build_parser():
|
||||
|
@@ -1,8 +1,8 @@
|
||||
# Copyright © 2023 Apple Inc.
|
||||
|
||||
from dataclasses import dataclass
|
||||
import math
|
||||
from typing import Optional, Tuple, List
|
||||
from dataclasses import dataclass
|
||||
from typing import List, Optional, Tuple
|
||||
|
||||
import mlx.core as mx
|
||||
import mlx.nn as nn
|
||||
|
Reference in New Issue
Block a user