MCPcopy Create free account

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

Functions2,622 in github.com/ml-explore/mlx-lm

↓ 4 callersFunctionload_dataset
(args, tokenizer: PreTrainedTokenizer)
mlx_lm/tuner/datasets.py:309
↓ 4 callersMethodload_weights
(self, weights, **kwargs)
tests/test_utils.py:105
↓ 4 callersMethodmake_mask
(self, *args, **kwargs)
mlx_lm/models/cache.py:393
↓ 4 callersFunctionmse
(x, y)
mlx_lm/quant/awq.py:154
↓ 4 callersFunctionquantize_model
Applies quantization to the model weights. Args: model (nn.Module): The model to be quantized. config (dict): Model configur
mlx_lm/utils.py:774
↓ 4 callersFunctionrprint
(*args, **kwargs)
mlx_lm/benchmark.py:89
↓ 4 callersFunctionrun_layer
( layer: nn.Module, x: mx.array, indices: mx.array | None = None, batch_size: int = 32, **
mlx_lm/quant/awq.py:165
↓ 4 callersMethodsave_data
(self, data)
tests/test_datsets.py:31
↓ 4 callersMethodset_linear
Set the self.linear layer and recompute self.m.
mlx_lm/tuner/dora.py:85
↓ 4 callersFunctionyarn_find_correction_dim
( num_rotations, dim, base=10000, max_position_embeddings=2048 )
mlx_lm/models/deepseek_v2.py:48
↓ 3 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/mamba.py:174
↓ 3 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/olmo.py:162
↓ 3 callersMethod__init__
( self, dims, traditional=False, max_position_embeddings=2048, base=10
mlx_lm/models/rope_utils.py:129
↓ 3 callersMethod_dequantized_weight
Return the weight of linear layer and dequantize it if is quantized
mlx_lm/tuner/dora.py:92
↓ 3 callersFunction_int_or_list
(arg, idx)
mlx_lm/models/hunyuan.py:45
↓ 3 callersMethod_make_state_machine
Make a new SequenceStateMachine or fetch it if we 've made it before. Return also a dictionary that maps the token sequences in the state
mlx_lm/server.py:626
↓ 3 callersFunction_normalize_arguments
( func_name: str, arguments: dict[str, Any], tools: list[Any] | None, string_args: set[str] |
mlx_lm/tool_parsers/glm47.py:56
↓ 3 callersMethod_tokenize
(self, texts)
mlx_lm/evaluate.py:140
↓ 3 callersFunctioncan_trim_prompt_cache
Check if model's cache can be trimmed.
mlx_lm/models/cache.py:88
↓ 3 callersFunctioncompute_bits_per_weight
(model)
mlx_lm/utils.py:210
↓ 3 callersFunctionconvert
( hf_path: str, mlx_path: str = "mlx_model", quantize: bool = False, q_group_size: Optional[in
mlx_lm/convert.py:85
↓ 3 callersFunctioncreate_attention_mask
( N: int, offset: int, return_array: bool, window_size: Optional[int] )
mlx_lm/models/cache.py:114
↓ 3 callersFunctioncreate_dataset
( data, tokenizer: PreTrainedTokenizer, config, )
mlx_lm/tuner/datasets.py:175
↓ 3 callersFunctioncreate_hf_dataset
(dataset_name, config, split, hf_config)
mlx_lm/tuner/datasets.py:252
↓ 3 callersFunctiongated_delta_ops
Ops-based reference implementation for prompt prefill (sequential loop). Supports both scalar and vectorized gating. Shapes: - q,
mlx_lm/models/gated_delta.py:214
↓ 3 callersMethodgenerate_response
Generate a single response packet based on response type (stream or not), completion type and parameters. Args:
mlx_lm/server.py:1259
↓ 3 callersFunctiongrad_checkpoint
Update all instances of type(layer) to use gradient checkpointing.
mlx_lm/tuner/trainer.py:25
↓ 3 callersMethodis_trimmable
(self)
mlx_lm/models/cache.py:375
↓ 3 callersFunctionload_model
Load and initialize the model from a given path. Args: model_path (Path): The path to load the model from. lazy (bool): If F
mlx_lm/utils.py:282
↓ 3 callersFunctionmain
()
mlx_lm/chat.py:90
↓ 3 callersMethodmake_state
(self)
mlx_lm/generate.py:986
↓ 3 callersMethodnext
Get the next batch of responses. Returns: Tuple of prompt processing responses and generation responses.
mlx_lm/generate.py:1847
↓ 3 callersFunctionpercentile
(data, percent)
benchmarks/server_benchmark.py:97
↓ 3 callersFunctionrprint
(*args, **kwargs)
mlx_lm/quant/dwq.py:86
↓ 3 callersFunctionsetup_arg_parser
Set up and return the argument parser.
mlx_lm/chat.py:21
↓ 3 callersMethodstop_and_join
(self)
mlx_lm/server.py:454
↓ 3 callersFunctionsubmodule_from_key
(module, key)
mlx_lm/quant/awq.py:158
↓ 3 callersMethodupdate_and_fetch
(self, keys, values)
mlx_lm/models/cache.py:942
↓ 3 callersFunctionupload_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
mlx_lm/utils.py:648
↓ 3 callersFunctionvalidate
(params, it)
mlx_lm/quant/dwq.py:128
↓ 2 callersMethod__call__
(self, x)
mlx_lm/models/afm7.py:277
↓ 2 callersMethod__init__
( self, input_dims: int, output_dims: int, r: int = 8, dropout: float
mlx_lm/tuner/lora.py:67
↓ 2 callersMethod__init__
(self, args: ModelArgs)
mlx_lm/models/longcat_flash_ngram.py:173
↓ 2 callersFunction_build_trie
Build an Aho-Corasick trie from the provided sequences See https://en.wikipedia.org/wiki/Aho–Corasick_algorithm .
mlx_lm/generate.py:896
↓ 2 callersFunction_clear_cache
(threshold: int)
mlx_lm/tuner/trainer.py:20
↓ 2 callersFunction_compute_targets
(data, path, split)
mlx_lm/quant/dwq.py:40
↓ 2 callersMethod_continued_generation_test_helper
(self, model)
tests/test_generate.py:588
↓ 2 callersMethod_convert_to_serializable
(self, data: dict)
mlx_lm/tuner/callbacks.py:47
↓ 2 callersMethod_convert_to_serializable
(self, data: dict)
mlx_lm/tuner/callbacks.py:85
↓ 2 callersMethod_custom_convolution
(self, u, weights, state=None)
mlx_lm/models/baichuan_m1.py:75
↓ 2 callersFunction_extract_name
Extract name from quoted string.
mlx_lm/tool_parsers/minimax_m2.py:14
↓ 2 callersFunction_format_top_logprobs
Returns info dicts for the top `top_n` tokens from `logprobs`
mlx_lm/server.py:426
↓ 2 callersFunction_gather_sort
(x, indices)
mlx_lm/models/switch_layers.py:12
↓ 2 callersMethod_get_per_layer_inputs
( self, input_ids: Optional[mx.array], input_embeddings: Optional[mx.array] = None,
mlx_lm/models/gemma4_text.py:444
↓ 2 callersMethod_is_batchable
(self, args)
mlx_lm/server.py:685
↓ 2 callersMethod_is_quantized
(self)
mlx_lm/tuner/dora.py:108
↓ 2 callersMethod_log_cache_stats
(self)
mlx_lm/server.py:461
↓ 2 callersFunction_make_logits_processors
(args)
mlx_lm/server.py:414
↓ 2 callersFunction_make_sampler
(args, tokenizer)
mlx_lm/server.py:399
↓ 2 callersFunction_match
(a, b)
mlx_lm/tokenizer_utils.py:508
↓ 2 callersMethod_maybe_trim_space
(self, current_text)
mlx_lm/tokenizer_utils.py:195
↓ 2 callersFunction_model_call
(input_tokens: mx.array, input_embeddings: Optional[mx.array])
mlx_lm/generate.py:388
↓ 2 callersMethod_next
(self)
mlx_lm/generate.py:1769
↓ 2 callersFunction_parse_single
Parse a single call:name{args} regex match into a tool call dict.
mlx_lm/tool_parsers/gemma4.py:46
↓ 2 callersFunction_parse_single_tool
(text: str)
mlx_lm/tool_parsers/kimi_k2.py:40
↓ 2 callersMethod_postprocess_text
(self, text)
mlx_lm/tokenizer_utils.py:488
↓ 2 callersFunction_prefill
(model, cache, y)
mlx_lm/generate.py:579
↓ 2 callersMethod_preprocess_text
(self, text)
mlx_lm/tokenizer_utils.py:485
↓ 2 callersFunction_process_and_sample
(tokens, logits)
mlx_lm/generate.py:544
↓ 2 callersFunction_rewind_cache
(num_draft, num_accept)
mlx_lm/generate.py:589
↓ 2 callersFunction_scatter_unsort
(x, inv_order, shape=None)
mlx_lm/models/switch_layers.py:20
↓ 2 callersMethod_score_fn
(self, inputs, cache: Optional[Any] = None, step_size: int = 2048)
mlx_lm/evaluate.py:107
↓ 2 callersMethod_set_cors_headers
(self)
mlx_lm/server.py:1075
↓ 2 callersMethod_share_object
(self, obj)
mlx_lm/server.py:484
↓ 2 callersMethod_step
Perform a single generation step. Returns: Tuple of token list and logprobs list.
mlx_lm/generate.py:1320
↓ 2 callersMethod_temporal_order
Rearrange the cache into temporal order.
mlx_lm/models/cache.py:1159
↓ 2 callersMethod_tokenize
Tokenize a request and split the prompt into segments. Returns a tuple * prompt - Full list of tokens * segments - A lis
mlx_lm/server.py:516
↓ 2 callersMethod_try_flush
(self, force=False)
mlx_lm/tokenizer_utils.py:135
↓ 2 callersFunction_unpack_awq_weights
(qweight: mx.array)
mlx_lm/utils.py:72
↓ 2 callersFunctionapply_rotary_emb
Apply RoPE with blocked layout. Args: x: Input tensor in (B, H, T, D) format offset: Position offset for KV caching base
mlx_lm/models/nanochat.py:32
↓ 2 callersFunctionchat_template_fn
(**extra_kwargs)
mlx_lm/evaluate.py:58
↓ 2 callersMethodcheck_tokenizer
(self, tokenizer)
tests/test_tokenizers.py:18
↓ 2 callersFunctionclamped_swiglu
(x, gate, limit)
mlx_lm/models/step3p5.py:19
↓ 2 callersFunctionclip_residual
(x, y)
mlx_lm/models/gemma3_text.py:126
↓ 2 callersFunctioncompute_dt
(dt, dt_bias, time_step_limit)
mlx_lm/models/ssm.py:8
↓ 2 callersMethodcompute_router_modalities
(self, x: mx.array)
mlx_lm/models/gemma3n.py:226
↓ 2 callersMethodconvert_ids_to_tokens
(self, t)
tests/test_server.py:293
↓ 2 callersFunctionconvert_to_gguf
( model_path: Union[str, Path], weights: dict, config: dict, output_file_path: str, )
mlx_lm/gguf.py:261
↓ 2 callersFunctiondequantize_model
Dequantize the quantized layers in the model. Args: model (nn.Module): The model with quantized layers. Returns: nn.Mod
mlx_lm/utils.py:853
↓ 2 callersMethodempty
( cls, model: nn.Module, fallback_sampler: Callable[[mx.array], mx.array], )
mlx_lm/generate.py:1467
↓ 2 callersMethodempty
(self)
mlx_lm/models/cache.py:400
↓ 2 callersFunctionerror
(*args, **kwargs)
mlx_lm/share.py:57
↓ 2 callersFunctioneval_ppl
(model, data, batch_size=8)
mlx_lm/quant/dynamic_quant.py:25
↓ 2 callersMethodextract_cache
(self, uids)
mlx_lm/generate.py:1684
↓ 2 callersFunctionfind_last_user_index
(messages: List[Dict[str, Any]])
mlx_lm/chat_templates/deepseek_v32.py:142
↓ 2 callersMethodfrom_path
(cls, root, path)
mlx_lm/share.py:46
↓ 2 callersMethodfrom_rms_norm
( cls, norm_module, *, group: Optional[mx.distributed.Group] = None )
mlx_lm/models/minimax.py:75
↓ 2 callersFunctiongated_delta_kernel
( q: mx.array, k: mx.array, v: mx.array, g: mx.array, beta: mx.array, state: mx.array,
mlx_lm/models/gated_delta.py:171
↓ 2 callersFunctiongeglu
(gate, x)
mlx_lm/models/gemma4_text.py:95
↓ 2 callersFunctionget_files
(path)
mlx_lm/share.py:104
← previousnext →201–300 of 2,622, ranked by callers