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:
Awni Hannun
2023-12-20 10:22:25 -08:00
committed by GitHub
parent aed14618ca
commit 27c0a8c002
62 changed files with 164 additions and 146 deletions

View File

@@ -5,10 +5,7 @@ import time
import mlx.core as mx
from whisper import load_models
from whisper import audio
from whisper import decoding
from whisper import transcribe
from whisper import audio, decoding, load_models, transcribe
audio_file = "whisper/assets/ls_test.flac"

View File

@@ -1,19 +1,18 @@
# Copyright © 2023 Apple Inc.
import os
import subprocess
import unittest
import mlx.core as mx
import numpy as np
import os
import subprocess
import torch
import whisper
import whisper.audio as audio
import whisper.decoding as decoding
import whisper.load_models as load_models
import whisper.torch_whisper as torch_whisper
import whisper.decoding as decoding
TEST_AUDIO = "whisper/assets/ls_test.flac"

View File

@@ -1,6 +1,4 @@
# Copyright © 2023 Apple Inc.
from . import load_models
from . import audio
from . import decoding
from . import audio, decoding, load_models
from .transcribe import transcribe

View File

@@ -1,12 +1,13 @@
# Copyright © 2023 Apple Inc.
import zlib
from dataclasses import dataclass, field, replace
from typing import Dict, Iterable, List, Optional, Sequence, Tuple, Union
import mlx.core as mx
from mlx.utils import tree_map
import mlx.nn as nn
import numpy as np
import zlib
from mlx.utils import tree_map
from .audio import CHUNK_LENGTH
from .tokenizer import Tokenizer, get_tokenizer

View File

@@ -7,13 +7,11 @@ import warnings
from typing import List
import mlx.core as mx
from mlx.utils import tree_map
import torch
from mlx.utils import tree_map
from tqdm import tqdm
from . import whisper
from . import torch_whisper
from . import torch_whisper, whisper
_MODELS = {
"tiny.en": "https://openaipublic.azureedge.net/main/whisper/models/d3dd57d32accea0b295c96e26691aa14d8822fac7d9d27d5dc00b4ca2826dd03/tiny.en.pt",

View File

@@ -1,12 +1,12 @@
# Copyright © 2023 Apple Inc.
import sys
from typing import Optional, Tuple, Union
import mlx.core as mx
import numpy as np
import sys
from typing import Optional, Tuple, Union
import tqdm
from .audio import (
FRAMES_PER_SECOND,
HOP_LENGTH,

View File

@@ -2,13 +2,12 @@
import base64
import gzip
from dataclasses import dataclass
import math
from dataclasses import dataclass
from typing import Dict, Iterable, Optional
import mlx.core as mx
import mlx.nn as nn
import numpy as np
from .decoding import decode as decode_function