MCPcopy Create free account

hub / github.com/ml-explore/mlx-examples / functions

Functions1,187 in github.com/ml-explore/mlx-examples

↓ 2 callersMethodsample_prior
(self, shape, dtype=mx.float32, key=None)
stable_diffusion/stable_diffusion/sampler.py:56
↓ 2 callersMethodsanitize
(weights)
llava/vision.py:208
↓ 2 callersFunctionsanitize_config
(config, weights)
llms/llama/llama.py:299
↓ 2 callersFunctionsave_adapters
(adapter_name, flux, args)
flux/dreambooth.py:46
↓ 2 callersFunctionsave_video
Save video frames to file using ffmpeg. Args: frames: Video tensor [T, H, W, C] (channels-last) in [-1, 1] or [0, 1] output_
video/wan2.1/wan/utils.py:173
↓ 2 callersMethodset_alignment_heads
(self, dump: Union[bytes, np.ndarray])
whisper/mlx_whisper/whisper.py:229
↓ 2 callersMethodset_timesteps
Build schedule by indexing into the full shifted schedule. Args: denoising_step_list: e.g. [1000, 750, 500, 250]. Each value V
video/wan2.1/wan/sampler.py:380
↓ 2 callersMethodshard
(self, group: Optional[mx.distributed.Group] = None)
flux/flux/model.py:100
↓ 2 callersFunctionshard_key
(k)
llms/llama/convert.py:30
↓ 2 callersFunctionsinusoidal_embedding_1d
(dim: int, position: mx.array)
video/wan2.1/wan/model.py:25
↓ 2 callersMethodsplit_tokens_on_unicode
(self, tokens: List[int])
whisper/mlx_whisper/tokenizer.py:288
↓ 2 callersFunctiontest_epoch
(model, test_iter)
speechcommands/main.py:111
↓ 2 callersFunctiontic
()
llms/llama/llama.py:198
↓ 2 callersFunctiontimestep_embedding
( t: mx.array, dim: int, max_period: int = 10000, time_factor: float = 1000.0 )
flux/flux/layers.py:46
↓ 2 callersMethodtimesteps
(self, num_steps: int, start_time=None, dtype=mx.float32)
stable_diffusion/stable_diffusion/sampler.py:70
↓ 2 callersFunctionto_latent_size
(image_size)
flux/generate_interactive.py:22
↓ 2 callersFunctionto_samples
(context_size, dataset)
transformer_lm/main.py:41
↓ 2 callersMethodtokenize
(self, text)
flux/flux/flux.py:48
↓ 2 callersMethodtokenize
(self, text, prepend_bos=True, append_eos=True)
clip/tokenizer.py:87
↓ 2 callersMethodtokenize
(self, text, prepend_bos=True, append_eos=True)
stable_diffusion/stable_diffusion/tokenizer.py:80
↓ 2 callersFunctiontorch_to_mx
(a: torch.Tensor, *, dtype: str)
llms/llama/convert.py:19
↓ 2 callersFunctiontranscribe
Transcribe an audio file using Whisper Parameters ---------- audio: Union[str, np.ndarray, mx.array] The path to the audio f
whisper/mlx_whisper/transcribe.py:62
↓ 2 callersMethodtruncate_cache
(self, num_to_truncate)
llms/speculative_decoding/model.py:295
↓ 2 callersFunctionuncrop_boxes_xyxy
(boxes: mx.array, crop_box: List[int])
segment_anything/segment_anything/utils/amg.py:239
↓ 2 callersFunctionupsample_nearest
(x, scale: int = 2)
stable_diffusion/stable_diffusion/unet.py:12
↓ 2 callersFunctionupsample_nearest
(x, scale: int = 2)
cvae/vae.py:10
↓ 1 callersMethod__init__
( self, embedding_dim: int, mlp_dim: int, act: Type[nn.Module] = nn.GELU,
segment_anything/segment_anything/common.py:8
↓ 1 callersMethod__init__
(self, config: CLIPTextModelConfig)
flux/flux/clip.py:79
↓ 1 callersMethod__init__
(self, n_layers: int, d_in: int, d_hidden: int, d_out: int)
normalizing_flow/flows.py:12
↓ 1 callersMethod__init__
(self, config: LlaVAConfig)
llava/llava.py:58
↓ 1 callersMethod__init__
(self, config: CLIPTextModelConfig)
stable_diffusion/stable_diffusion/clip.py:65
↓ 1 callersMethod__init__
(self, model: str = _DEFAULT_MODEL, float16: bool = False)
stable_diffusion/stable_diffusion/__init__.py:20
↓ 1 callersMethod__init__
(self, x_dim, h_dim, out_dim, nb_layers=2, dropout=0.5, bias=True)
gcn/gcn.py:15
↓ 1 callersFunction_ab_plus_cd
(a, b, c, d)
flux/flux/layers.py:25
↓ 1 callersMethod_attend
Compute text cross-attention. Returns (q, attn_out) both [B, n, L, d].
video/wan2.1/wan/layers.py:94
↓ 1 callersMethod_denoising_loop
( self, x_t, x_ids, txt, txt_ids, vec, num_steps: int
flux/flux/flux.py:87
↓ 1 callersMethod_denoising_step
( self, x_t, t, t_prev, conditioning, cfg_weight: float = 7.5, text_time=None )
stable_diffusion/stable_diffusion/__init__.py:67
↓ 1 callersMethod_detect_language
(self, audio_features: mx.array, tokens: np.array)
whisper/mlx_whisper/decoding.py:557
↓ 1 callersFunction_download
(url: str, root: str)
whisper/convert.py:62
↓ 1 callersMethod_embed_boxes
Embeds box prompts.
segment_anything/segment_anything/prompt_encoder.py:82
↓ 1 callersMethod_embed_image
Project CLIP features through img_emb MLP.
video/wan2.1/wan/model.py:95
↓ 1 callersMethod_embed_masks
Embeds mask inputs.
segment_anything/segment_anything/prompt_encoder.py:91
↓ 1 callersMethod_embed_points
Embeds point prompts.
segment_anything/segment_anything/prompt_encoder.py:50
↓ 1 callersMethod_encode_clip
Encode image with CLIP. Returns [1, 257, 1280].
video/wan2.1/wan/pipeline.py:106
↓ 1 callersMethod_encode_frame
Encodes the given input using the underlying VQVAE.
encodec/encodec.py:481
↓ 1 callersMethod_encode_frame
Encodes the given input using the underlying VQVAE.
musicgen/encodec.py:481
↓ 1 callersMethod_encode_image
(self, input_img: ImageFile.ImageFile, num_augmentations: int)
flux/flux/trainer.py:62
↓ 1 callersMethod_encode_null
Return cached empty-string T5 embedding for CFG.
video/wan2.1/wan/pipeline.py:100
↓ 1 callersMethod_encode_prompt
(self, prompt)
flux/flux/trainer.py:71
↓ 1 callersFunction_euler_step
(model_output, sample, sigma, sigma_next)
video/wan2.1/wan/sampler.py:361
↓ 1 callersFunction_flatten
(params)
stable_diffusion/stable_diffusion/model_io.py:167
↓ 1 callersMethod_generate_masks
(self, image: np.ndarray)
segment_anything/segment_anything/automatic_mask_generator.py:191
↓ 1 callersMethod_get_audio_features
(self, mel: mx.array)
whisper/mlx_whisper/decoding.py:537
↓ 1 callersMethod_get_batch_size
Gets the batch size of the output given the batch size of the input prompts.
segment_anything/segment_anything/prompt_encoder.py:96
↓ 1 callersMethod_get_extra_padding_for_conv1d
( self, hidden_states: mx.array, )
encodec/encodec.py:127
↓ 1 callersMethod_get_extra_padding_for_conv1d
( self, hidden_states: mx.array, )
musicgen/encodec.py:127
↓ 1 callersMethod_get_initial_tokens
(self)
whisper/mlx_whisper/decoding.py:480
↓ 1 callersMethod_get_mask
(self, N, dtype)
flux/flux/clip.py:90
↓ 1 callersMethod_get_mask
(self, N, dtype)
stable_diffusion/stable_diffusion/clip.py:81
↓ 1 callersMethod_get_num_accept
(self, draft_tokens, draft_probs, model_logits)
llms/speculative_decoding/decoder.py:91
↓ 1 callersMethod_get_suppress_tokens
(self)
whisper/mlx_whisper/decoding.py:508
↓ 1 callersMethod_init_step_index
(self, timestep)
video/wan2.1/wan/sampler.py:307
↓ 1 callersFunction_interp
Interpolate the function defined by (arange(0, len(y)), y) at positions x_new.
stable_diffusion/stable_diffusion/sampler.py:13
↓ 1 callersMethod_linear_overlap_add
(frames: List[mx.array], stride: int)
encodec/encodec.py:582
↓ 1 callersMethod_linear_overlap_add
(frames: List[mx.array], stride: int)
musicgen/encodec.py:582
↓ 1 callersMethod_main_loop
(self, audio_features: mx.array, tokens: mx.array)
whisper/mlx_whisper/decoding.py:572
↓ 1 callersFunction_map_vae_downsample_key
(key: str)
video/wan2.1/wan/vae.py:497
↓ 1 callersFunction_map_vae_upsample_key
(key: str)
video/wan2.1/wan/vae.py:473
↓ 1 callersMethod_maybe_download
(self, data_dir)
lora/data/wikisql.py:32
↓ 1 callersMethod_merge_qkv_weights
Merge separate q/k/v weights into qkv (self-attn) and kv (cross-attn).
video/wan2.1/wan/model.py:260
↓ 1 callersFunction_pad
(x, padding, pad_mode="constant")
whisper/mlx_whisper/audio.py:112
↓ 1 callersMethod_parse_queries
(self, queries)
lora/data/wikisql.py:54
↓ 1 callersMethod_parse_tables
(self, tables)
lora/data/wikisql.py:43
↓ 1 callersMethod_precompute_teacache
Precompute time embeddings and TeaCache skip schedule. Returns: (all_t_emb, all_e0, skip_mask): Lists of precomputed embeddings
video/wan2.1/wan/pipeline.py:159
↓ 1 callersMethod_prepare_conditioning
(self, n_images, t5_tokens, clip_tokens)
flux/flux/flux.py:73
↓ 1 callersMethod_prepare_image_conditioning
Prepare VAE-encoded first frame + temporal mask. Returns: y: [T', H', W', 20] conditioning tensor (channels-last)
video/wan2.1/wan/pipeline.py:113
↓ 1 callersMethod_preprocess
(self, image: Image)
clip/image_processor.py:42
↓ 1 callersMethod_process_batch
( self, points: np.ndarray, im_size: Tuple[int, ...], crop_box: List[int],
segment_anything/segment_anything/automatic_mask_generator.py:258
↓ 1 callersMethod_process_crop
( self, image: np.ndarray, crop_box: List[int], crop_layer_idx: int, o
segment_anything/segment_anything/automatic_mask_generator.py:217
↓ 1 callersMethod_random_crop_resize
(self, img)
flux/flux/trainer.py:20
↓ 1 callersMethod_recombine_heads
(self, x: mx.array)
segment_anything/segment_anything/transformer.py:208
↓ 1 callersFunction_relative_position_bucket
Adapted from HF Tensorflow: https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_t5.py Translate re
llms/speculative_decoding/model.py:10
↓ 1 callersFunction_relative_position_bucket
Adapted from HF Tensorflow: https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_t5.py Translate re
musicgen/t5.py:45
↓ 1 callersFunction_relative_position_bucket
Adapted from HF Tensorflow: https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_t5.py Translate re
t5/t5.py:45
↓ 1 callersMethod_relative_position_bucket
(rpos, bidirectional, num_buckets, max_distance)
flux/flux/t5.py:79
↓ 1 callersMethod_relative_position_bucket
(self, rel_pos)
video/wan2.1/wan/t5.py:28
↓ 1 callersFunction_rope
(pos: mx.array, dim: int, theta: float)
flux/flux/layers.py:12
↓ 1 callersFunction_rope_3d
(x, f, h, w, frame_dim, height_dim, width_dim, theta)
video/wan2.1/wan/rope.py:32
↓ 1 callersMethod_verify_options
(self, options: DecodingOptions)
whisper/mlx_whisper/decoding.py:465
↓ 1 callersFunctionadd_decomposed_rel_pos
Calculate decomposed Relative Positional Embeddings from :paper:`mvitv2`. https://github.com/facebookresearch/mvit/blob/19786631e330df9f3622e
segment_anything/segment_anything/image_encoder.py:347
↓ 1 callersMethodadd_noise
(self, x, t, noise=None, key=None)
flux/flux/sampler.py:47
↓ 1 callersFunctionadd_word_timestamps
( *, segments: List[dict], model: "Whisper", tokenizer: Tokenizer, mel: mx.array, num_
whisper/mlx_whisper/timing.py:220
↓ 1 callersMethodapply_boxes
Expects a mlx tensor with shape ...x4. Requires the original image size in (H, W) format.
segment_anything/segment_anything/utils/transforms.py:46
↓ 1 callersMethodapply_image
Expects a numpy array with shape HxWxC in uint8 format.
segment_anything/segment_anything/utils/transforms.py:20
↓ 1 callersFunctionarea_from_rle
(rle: Dict[str, Any])
segment_anything/segment_anything/utils/amg.py:148
↓ 1 callersFunctionbacktrace
(trace: np.ndarray)
whisper/mlx_whisper/timing.py:48
↓ 1 callersFunctionbatch_iterate
(batch_size, X, y)
mnist/main.py:38
↓ 1 callersFunctionbatch_iterator
(batch_size: int, *args)
segment_anything/segment_anything/utils/amg.py:92
↓ 1 callersFunctionbatched_iou
Compute IoU for batched boxes. Args: boxes_a (mx.array): [..., [x1, y1, x2, y2]] sized Mx4 boxes_b (mx.array): [..., [x1, y1, x2,
segment_anything/segment_anything/automatic_mask_generator.py:384
↓ 1 callersMethodbpe
(self, text)
flux/flux/tokenizers.py:38
← previousnext →201–300 of 1,187, ranked by callers