Commit 79ffb78 1 parent 9bb44a0 commit 79ffb78 Copy full SHA for 79ffb78
File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1
- import requests
1
+ import platform
2
+ import os
3
+ os_name = platform .system ()
2
4
from magnet .utils .globals import _f
3
- from magnet .utils .mlx import mistral
5
+ if os_name == 'Darwin' and not os .getenv ('DOCKER_ENV' ):
6
+ try :
7
+ from magnet .utils .mlx import mistral
8
+ except ImportError :
9
+ _f ("warn" , "MLX module not found on macOS without DOCKER_ENV" )
10
+
4
11
import json
5
12
6
13
class LocalInference :
Original file line number Diff line number Diff line change 1
1
# Copyright © 2023 Apple Inc.
2
2
# docstrings - 2023 Prismadic, LLC.
3
-
3
+ import os
4
4
import json
5
5
import time
6
6
from dataclasses import dataclass
7
7
from pathlib import Path
8
8
from typing import List , Optional , Tuple
9
9
import platform
10
- is_darwin = platform .system () == 'Darwin'
10
+ os_name = platform .system ()
11
11
12
- if is_darwin :
12
+ if os_name == 'Darwin' and not os . getenv ( 'DOCKER_ENV' ) :
13
13
import mlx .core as mx
14
14
import mlx .nn as nn
15
15
from mlx .utils import tree_unflatten
16
16
17
17
from sentencepiece import SentencePieceProcessor
18
18
from magnet .utils .globals import _f
19
19
from magnet .utils .data_classes import MistralArgs
20
- import torch .nn as nn
21
20
22
21
class RMSNorm (nn .Module ):
23
22
def __init__ (self , dims : int , eps : float = 1e-5 ):
You can’t perform that action at this time.
0 commit comments