mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-09-01 04:14:38 +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:
@@ -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"
|
||||
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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",
|
||||
|
@@ -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,
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user