Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ml-explore/mlx-examples
/ functions
Functions
1,187 in github.com/ml-explore/mlx-examples
⨍
Functions
1,187
◇
Types & classes
308
↳
Endpoints
13
↓ 1 callers
Function
save_config
Save the model configuration to the ``config_path``. The final configuration will be sorted before saving for better readability. Args:
flux/flux/utils.py:213
↓ 1 callers
Function
save_config
Save the model configuration to the ``config_path``. The final configuration will be sorted before saving for better readability. Args:
encodec/convert.py:98
↓ 1 callers
Function
save_weights
Save model weights into specified directory.
segment_anything/convert.py:11
↓ 1 callers
Function
save_weights
Save model weights into specified directory.
clip/convert.py:28
↓ 1 callers
Function
save_weights
(save_path: Union[str, Path], weights: Dict[str, Any])
encodec/convert.py:76
↓ 1 callers
Method
set_image
Calculates the image embeddings for the provided image, allowing masks to be predicted with the 'predict' method. Args:
segment_anything/segment_anything/predictor.py:27
↓ 1 callers
Function
setup_arg_parser
Set up and return the argument parser.
flux/dreambooth.py:62
↓ 1 callers
Function
single_step
(x, t5_feat, clip_feat, guidance)
flux/dreambooth.py:194
↓ 1 callers
Function
sinusoids
Returns sinusoids for positional embedding
whisper/mlx_whisper/torch_whisper.py:51
↓ 1 callers
Function
sinusoids
Returns sinusoids for positional embedding
whisper/mlx_whisper/whisper.py:31
↓ 1 callers
Method
speculative_decode
( self, prompt, max_tokens: int = 100, )
llms/speculative_decoding/decoder.py:105
↓ 1 callers
Method
split_to_word_tokens
(self, tokens: List[int])
whisper/mlx_whisper/tokenizer.py:279
↓ 1 callers
Method
split_tokens_on_spaces
(self, tokens: List[int])
whisper/mlx_whisper/tokenizer.py:313
↓ 1 callers
Function
step
(x, t5_feat, clip_feat, guidance, prev_grads, perform_step)
flux/dreambooth.py:235
↓ 1 callers
Function
step
(inputs)
transformer_lm/main.py:101
↓ 1 callers
Function
step
(X, y)
mnist/main.py:69
↓ 1 callers
Function
step
(x)
normalizing_flow/main.py:37
↓ 1 callers
Function
step
(x, y)
speechcommands/main.py:69
↓ 1 callers
Function
step
(inp, tgt)
cifar/main.py:62
↓ 1 callers
Function
step
(X)
cvae/main.py:108
↓ 1 callers
Function
step
()
gcn/main.py:55
↓ 1 callers
Method
step
(self, pred, x_t, t, t_prev)
flux/flux/sampler.py:56
↓ 1 callers
Method
step
(self, eps_pred, x_t, t, t_prev)
stable_diffusion/stable_diffusion/sampler.py:76
↓ 1 callers
Method
step
Euler flow-matching update: x_new = x + f * (sigma_next - sigma).
video/wan2.1/wan/sampler.py:397
↓ 1 callers
Function
stft
(x, window, nperseg=256, noverlap=None, nfft=None, axis=-1, pad_mode="reflect")
whisper/mlx_whisper/audio.py:106
↓ 1 callers
Function
test_epoch
(model, test_iter, epoch)
cifar/main.py:100
↓ 1 callers
Method
timesteps
( self, num_steps, image_sequence_length, start: float = 1, stop: float = 0 )
flux/flux/sampler.py:23
↓ 1 callers
Method
to_language_token
(self, language)
whisper/mlx_whisper/tokenizer.py:221
↓ 1 callers
Function
to_latent_size
(image_size)
flux/txt2image.py:14
↓ 1 callers
Method
to_linear
(self)
lora/models.py:61
↓ 1 callers
Method
to_numpy
(self)
segment_anything/segment_anything/utils/amg.py:66
↓ 1 callers
Method
tokenize
(self, text, prepend_bos=True, append_eos=True)
flux/flux/tokenizers.py:83
↓ 1 callers
Method
tokenize
(self, text, prepend_bos=True, append_eos=True, pad=True)
flux/flux/tokenizers.py:160
↓ 1 callers
Function
top_k_sampling
Apply top-k sampling to logits. Args: logits: The logits from the model's output. top_k: Sample from the top k logits.
musicgen/musicgen.py:149
↓ 1 callers
Function
torch_to_mx
(a: torch.Tensor, *, dtype: str)
clip/convert.py:83
↓ 1 callers
Function
train
(model, train_set, val_set, optimizer, loss, tokenizer, args)
lora/lora.py:243
↓ 1 callers
Function
train_epoch
(model, train_iter, optimizer, epoch)
speechcommands/main.py:59
↓ 1 callers
Function
train_epoch
(model, train_iter, optimizer, epoch)
cifar/main.py:37
↓ 1 callers
Function
train_val_test_mask
Splits the loaded dataset into train/validation/test sets.
gcn/datasets.py:41
↓ 1 callers
Function
translate_weight_names
(name)
llms/gguf_llm/models.py:240
↓ 1 callers
Function
uncrop_masks
( masks: mx.array, crop_box: List[int], orig_h: int, orig_w: int )
segment_anything/segment_anything/utils/amg.py:257
↓ 1 callers
Function
uncrop_points
(points: mx.array, crop_box: List[int])
segment_anything/segment_anything/utils/amg.py:248
↓ 1 callers
Function
unshard
(k, v)
llms/llama/convert.py:36
↓ 1 callers
Method
update_and_fetch
(self, keys, values)
musicgen/musicgen.py:43
↓ 1 callers
Function
upload_to_hub
(path: str, name: str, torch_name_or_path: str)
whisper/convert.py:256
↓ 1 callers
Function
upload_to_hub
Uploads the model to Hugging Face hub. Args: path (str): Local path to the model. upload_repo (str): Name of the HF repo to
encodec/convert.py:27
↓ 1 callers
Function
window_partition
Partition into non-overlapping windows with padding if needed. Args: x (mx.array): input tokens with [B, H, W, C]. window_siz
segment_anything/segment_anything/image_encoder.py:257
↓ 1 callers
Function
window_unpartition
Window unpartition into original sequences and removing padding. Args: windows (mx.array): input tokens with [B * num_windows, window
segment_anything/segment_anything/image_encoder.py:281
↓ 1 callers
Function
word_anomaly_score
(word: dict)
whisper/mlx_whisper/transcribe.py:321
↓ 1 callers
Function
write_masks_to_folder
(masks: List[Dict[str, Any]], path: str)
segment_anything/main.py:138
↓ 1 callers
Method
write_result
( self, result: dict, file: TextIO, options: Optional[dict] = None, **kwargs )
whisper/mlx_whisper/writers.py:53
Method
__call__
Predict masks given image and prompt embeddings. Args: image_embeddings (mx.array): the embeddings from the image encode
segment_anything/segment_anything/mask_decoder.py:75
Method
__call__
(self, x)
segment_anything/segment_anything/mask_decoder.py:191
Method
__call__
(self, x)
segment_anything/segment_anything/mask_decoder.py:240
Method
__call__
(self, x: mx.array)
segment_anything/segment_anything/image_encoder.py:83
Method
__call__
(self, x)
segment_anything/segment_anything/image_encoder.py:114
Method
__call__
(self, x: mx.array)
segment_anything/segment_anything/image_encoder.py:167
Method
__call__
(self, x: mx.array)
segment_anything/segment_anything/image_encoder.py:225
Method
__call__
(self, x: mx.array)
segment_anything/segment_anything/image_encoder.py:420
Method
__call__
(self, x: mx.array)
segment_anything/segment_anything/common.py:19
Method
__call__
(self, x: mx.array)
segment_anything/segment_anything/common.py:30
Method
__call__
Args: image_embedding (mx.array): image to attend to. Should be shape B x h x w x embedding_dim for any h and w.
segment_anything/segment_anything/transformer.py:56
Method
__call__
( self, queries: mx.array, keys: mx.array, query_pe: mx.array, key_pe: mx.array )
segment_anything/segment_anything/transformer.py:144
Method
__call__
(self, q: mx.array, k: mx.array, v: mx.array)
segment_anything/segment_anything/transformer.py:213
Method
__call__
Predicts masks end-to-end from provided images and prompts. If prompts are not known in advance, using SamPredictor is recomm
segment_anything/segment_anything/sam.py:49
Method
__call__
Embeds different types of prompts, returning both sparse and dense embeddings. Args: points (tuple(mx.array, mx.
segment_anything/segment_anything/prompt_encoder.py:114
Method
__call__
(self, x)
segment_anything/segment_anything/prompt_encoder.py:184
Method
__call__
Generate positional encoding for a grid of the specified size.
segment_anything/segment_anything/prompt_encoder.py:210
Method
__call__
(self, x, attn_mask=None)
flux/flux/clip.py:62
Method
__call__
(self, x)
flux/flux/clip.py:127
Method
__call__
(self, ids: mx.array)
flux/flux/layers.py:68
Method
__call__
(self, x: mx.array)
flux/flux/layers.py:84
Method
__call__
(self, q: mx.array, k: mx.array)
flux/flux/layers.py:94
Method
__call__
(self, x: mx.array, pe: mx.array)
flux/flux/layers.py:108
Method
__call__
(self, x: mx.array)
flux/flux/layers.py:136
Method
__call__
( self, img: mx.array, txt: mx.array, vec: mx.array, pe: mx.array )
flux/flux/layers.py:183
Method
__call__
(self, x: mx.array, vec: mx.array, pe: mx.array)
flux/flux/layers.py:281
Method
__call__
(self, x: mx.array, vec: mx.array)
flux/flux/layers.py:317
Method
__call__
Compute binned relative position bias
flux/flux/t5.py:98
Method
__call__
( self, queries: mx.array, keys: mx.array, values: mx.array, mask: Opt
flux/flux/t5.py:129
Method
__call__
(self, x)
flux/flux/t5.py:182
Method
__call__
(self, x, mask)
flux/flux/t5.py:200
Method
__call__
(self, x: mx.array)
flux/flux/t5.py:219
Method
__call__
(self, inputs: mx.array)
flux/flux/t5.py:243
Method
__call__
(self, x: mx.array)
flux/flux/autoencoder.py:41
Method
__call__
(self, x)
flux/flux/autoencoder.py:85
Method
__call__
(self, x: mx.array)
flux/flux/autoencoder.py:108
Method
__call__
(self, x: mx.array)
flux/flux/autoencoder.py:121
Method
__call__
(self, x: mx.array)
flux/flux/autoencoder.py:183
Method
__call__
(self, z: mx.array)
flux/flux/autoencoder.py:271
Method
__call__
(self, z: mx.array)
flux/flux/autoencoder.py:301
Method
__call__
(self, x: mx.array)
flux/flux/autoencoder.py:356
Method
__call__
(self, x)
flux/flux/lora.py:73
Method
__call__
( self, img: mx.array, img_ids: mx.array, txt: mx.array, txt_ids: mx.a
flux/flux/model.py:141
Method
__call__
(self, x)
transformer_lm/main.py:32
Method
__call__
(self, x)
mnist/main.py:28
Method
__call__
(self, x)
lora/models.py:122
Method
__call__
( self, x: mx.array, mask: Optional[mx.array] = None, cache: Optional[Tuple[mx
lora/models.py:160
Method
__call__
(self, x)
lora/models.py:199
Method
__call__
( self, x: mx.array, mask: Optional[mx.array] = None, cache: Optional[Tuple[mx
lora/models.py:216
← previous
next →
501–600 of 1,187, ranked by callers