MCPcopy Create free account

hub / github.com/MakazhanAlpamys/Soup / functions

Functions20,206 in github.com/MakazhanAlpamys/Soup

↓ 20 callersFunctionapply_training_seed
Seed python / numpy / torch before the model and adapter are built. Returns the seed applied so a caller can report it.
src/soup_cli/utils/seeding.py:72
↓ 20 callersFunctionbuild_quantization_config_for_loader
Single entry point for trainers — returns a transformers quantization_config object (or ``None`` for ``quantization='none'``). Lazy-imports t
src/soup_cli/utils/quant_menu.py:327
↓ 20 callersMethodclose
(self)
tests/test_review_fixes_v07133.py:574
↓ 20 callersFunctionextract_mcq_letter
Pull the model's chosen MCQ option letter (A–J) from ``output``. Three "explicit commitment" forms are considered together — a LaTeX ``\\boxe
src/soup_cli/eval/forgetting.py:96
↓ 20 callersFunctionloop_env
Isolated cwd + registry DB for loop tests; returns a state factory.
tests/test_v0714.py:669
↓ 20 callersFunctionparse_expression
Parse a task-arithmetic expression into signed ``TaskTerm``s. Grammar (NO ``eval``): ``expr := term (('+'|'-') term)*`` where ``term := [sign
src/soup_cli/utils/adapter_arithmetic.py:75
↓ 20 callersFunctionread_state
Load a ``LoopState`` from disk.
src/soup_cli/utils/loop_state.py:246
↓ 20 callersFunctionrecord_verdict
Append a verdict to the history log under an exclusive file lock. Raises ``TypeError`` / ``ValueError`` on shape errors so the CLI layer can
src/soup_cli/utils/advise_history.py:113
↓ 20 callersFunctionrun_blame
Live DataInf-style blame runner. Executes the v0.57.0 plan and returns top-K row influences. The ``probe_fn`` closure returns ``(row_grads, p
src/soup_cli/utils/blame.py:378
↓ 20 callersMethodstep
(self)
tests/test_part_e.py:72
↓ 20 callersFunctiontraining_seed_kwargs
``seed`` / ``data_seed`` kwargs for any ``TrainingArguments`` subclass. ``data_seed`` stays ``None`` when unset: HF reads that as "follow ``seed`
src/soup_cli/utils/seeding.py:59
↓ 19 callersFunction_load
(**overrides)
tests/test_issue341_seed_and_fullft.py:75
↓ 19 callersFunction_ship_evidence
A SHIP evidence payload (task improves, no regression).
tests/test_v07139.py:43
↓ 19 callersFunction_tiny_stream
A streamed model over a real (tiny) on-disk Llama checkpoint.
tests/test_v07203.py:1246
↓ 19 callersFunction_write_evidence
(path: Path, payload: dict)
tests/test_v07139.py:39
↓ 19 callersFunctionapply_v028_speed_memory
Apply Cut-CE / FP8 / kernel-auto-compose features to ``model``. Returns a dict ``{feature_name: applied}`` so the caller can log the decision
src/soup_cli/utils/v028_features.py:27
↓ 19 callersMethodattach
(self, trainer)
src/soup_cli/utils/dpo_variants.py:120
↓ 19 callersFunctionattach_plugin_callback
Attach :class:`SoupPluginCallback` when any enabled plugin implements a hook. Returns ``True`` when a callback was attached, ``False`` otherwise
src/soup_cli/utils/peft_wiring.py:450
↓ 19 callersFunctioncompute_noise_floor
Measure the instrument's resolution from repeated BASE-model runs. Each element of ``runs`` is one ``{axis: score}`` map from an independent
src/soup_cli/utils/ship_verdict.py:237
↓ 19 callersFunctiondiscover_canaries
Build a :class:`CanarySet` from training rows. Algorithm: 1. Cluster rows by token-set Jaccard distance. 2. Pick top-N rows from each
src/soup_cli/utils/canary_discovery.py:205
↓ 19 callersFunctiongenerate_ed25519_private_pem
Generate a fresh ed25519 private key and return its PKCS8 PEM string.
src/soup_cli/utils/signing.py:67
↓ 19 callersFunctionget_gpu_info
Get GPU memory info.
src/soup_cli/utils/gpu.py:113
↓ 19 callersFunctionmigrate_llamafactory
Parse a LLaMA-Factory YAML config and return a Soup config dict. Returns a dict suitable for config_to_yaml(). Includes a ``_warnings`` key w
src/soup_cli/migrate/llamafactory.py:41
↓ 19 callersFunctionscore_citations
Compute citation precision / recall / F1. Precision = |predicted ∩ expected| / |predicted|. Recall = |predicted ∩ expected| / |expected|.
src/soup_cli/utils/citation_faithful.py:167
↓ 19 callersFunctionvalidate_hub_name
Validate ``name`` against ``SUPPORTED_HUBS`` and return canonical form. Mirrors v0.41.0 ``validate_optimizer_name`` policy: rejects non-strin
src/soup_cli/utils/hubs.py:60
↓ 18 callersFunction_base
(**training)
tests/test_preference_multi.py:20
↓ 18 callersFunction_fake_weights_dir
A tiny llama-shaped checkpoint. Shapes are block-size friendly.
tests/test_v07202.py:125
↓ 18 callersFunction_make_adapter
(tmp_path: Path, name: str = "adapter")
tests/test_v0600_part_b.py:24
↓ 18 callersFunction_nf4_stream
Shard a tiny Llama as NF4 and build the streamed model over it. ``quant_device`` is pinned to the training device on purpose: CPU and CUDA ag
tests/test_v07202.py:985
↓ 18 callersFunction_parse_json_array
Parse a JSON array from LLM output, handling markdown code blocks. Delegates to soup_cli.data.providers._utils.parse_json_array to avoid circ
src/soup_cli/commands/generate.py:905
↓ 18 callersFunction_torch_or_skip
()
tests/test_v07122.py:56
↓ 18 callersFunctionattach_curriculum_callback
Attach :class:`DynamicCurriculumCallback` when ``curriculum_dynamic=true``. Returns ``True`` when attached, ``False`` otherwise. The schema-level
src/soup_cli/utils/peft_wiring.py:106
↓ 18 callersFunctionbuild_peft_config
Build a peft config spec from Soup's schema LoraConfig. Returns: Dict with keys: - ``peft_cls``: str — class name to import from
src/soup_cli/utils/peft_builder.py:14
↓ 18 callersFunctionjudge_filter_pairs
Filter ``pairs`` by LLM-judge confidence. The judge scores ``chosen`` and ``rejected`` independently. Each weighted score is normalised to ``
src/soup_cli/data/traces/quality.py:62
↓ 18 callersMethodrecord_edit
Append a completed edit to the governor's history.
src/soup_cli/utils/edit_governor.py:283
↓ 18 callersMethodsave_model
(self, output_dir)
src/soup_cli/trainer/embedding.py:511
↓ 18 callersFunctionscore_refusal
Score refusal-rate regression vs base. Score = 1 - 0.5 * |Δharmful_refusal| - 0.5 * |Δbenign_refusal|. ``lang`` selects the heuristic patter
src/soup_cli/utils/diagnose/refusal.py:232
↓ 18 callersMethodto_dict
(self)
src/soup_cli/utils/irt.py:156
↓ 18 callersMethodzero_grad
(self, set_to_none: bool = False)
tests/test_part_e.py:69
↓ 17 callersFunction_build_streamed_wrapper
Build a task wrapper through the REAL `setup()` path, streaming. ``device`` defaults to the real accelerator, because `TrainingArguments` pic
tests/test_v07204.py:302
↓ 17 callersMethod_get_conn
(self)
src/soup_cli/registry/store.py:216
↓ 17 callersFunction_make_record
(**overrides)
tests/test_v0580.py:658
↓ 17 callersMethod_names
(self)
tests/test_v07134.py:27
↓ 17 callersFunction_parse_sweep_params
Parse sweep parameter strings into a dict of {key: [values]}.
src/soup_cli/commands/sweep.py:183
↓ 17 callersFunction_patch_tokenizer
Make ``commands/data_doctor.py``'s ``engine.resolve_tokenizer`` return ``tok``.
tests/test_v07127.py:1575
↓ 17 callersFunction_plain
ANSI-stripped, whitespace-collapsed CLI output, safe to substring-match. Collapsing whitespace as well as stripping escapes is deliberate: Rich a
tests/test_v07302.py:60
↓ 17 callersFunction_tiny_llama_dir
A real (tiny) Llama checkpoint on disk — no network. ``hidden_size`` is 64 and NOT 32, and that is load-bearing for the NF4 tests. bitsandbyt
tests/test_v07202.py:741
↓ 17 callersFunction_yaml
Minimal SoupConfig YAML that exercises the mitigation gate.
tests/test_v07126.py:77
↓ 17 callersFunctionapply_edit
Apply a knowledge edit live (v0.71.9 #194 / #197 / #203; v0.71.16 #250). ROME / MEMIT / AlphaEdit run the rank-1 weight-edit kernel; ``grace``
src/soup_cli/utils/knowledge_edit.py:268
↓ 17 callersFunctionattach_relora_callback
Attach :class:`ReLoRACallback` when ``training.relora_steps`` is set. Returns ``True`` when a callback was attached, ``False`` otherwise. The
src/soup_cli/utils/peft_wiring.py:52
↓ 17 callersFunctionclassify_score
Map ``score in [0, 1]`` → ``OK`` / ``MINOR`` / ``MAJOR``. Rejects bool (subclass of int — matches project bool-as-int policy), non-finite, an
src/soup_cli/utils/diagnose/report.py:38
↓ 17 callersFunctionconvert_apple_adapter
Run the live adapter conversion described by ``plan``. Live since v0.71.21 (#228) for the ``hf-to-mlx`` / ``mlx-to-hf`` directions; the two `
src/soup_cli/utils/apple_adapter.py:522
↓ 17 callersFunctionlaunch_rollout
Run the named rollout backend and return its normalised result. Live since v0.71.21 (#125): - ``openenv`` resolves ``rollout_func`` (``modul
src/soup_cli/utils/agent_rollout.py:312
↓ 17 callersMethodlog_metrics
Log a single metrics row for the given run.
src/soup_cli/experiment/tracker.py:193
↓ 17 callersFunctionmake_judge_provider_fn
Build a ``judge(prompt) -> {'text': str}`` callable for ``provider``. Args: provider: one of ``"ollama"`` / ``"anthropic"`` / ``"vllm"``.
src/soup_cli/utils/data_forge.py:526
↓ 17 callersFunctionmerge_task_arithmetic_concat
Exact concatenation-based task arithmetic over MIXED-rank LoRA adapters. For each LoRA module shared (as a complete A/B pair) across every adapte
src/soup_cli/utils/adapter_arithmetic.py:405
↓ 17 callersFunctionmessages_to_format
Convert unified messages format back to a specific format. Input: {"messages": [{"role": ..., "content": ...}, ...]} Output: dict in target f
src/soup_cli/data/formats.py:440
↓ 17 callersMethodrecord_call
( self, *, name: str, started_ts: float, duration_ms: float, s
src/soup_cli/utils/tool_outputs.py:62
↓ 17 callersFunctionvalidate_and_stats
Compute stats and validate dataset.
src/soup_cli/data/validator.py:10
↓ 17 callersFunctionvalidate_steering_strength
Validate a steering strength multiplier. Bool-rejected (bool is a subclass of int), NaN/Inf-rejected via ``math.isfinite``, bounded ``|streng
src/soup_cli/utils/steering.py:149
↓ 16 callersFunction_bang_policy
(**kw)
tests/test_v07126.py:772
↓ 16 callersMethod_data
(self, tmp_path, rows: int = 200)
tests/test_v07133.py:1114
↓ 16 callersFunction_enable_hf_transfer_progress
Enable Rich progress bars for HuggingFace Hub file downloads.
src/soup_cli/trainer/sft.py:1573
↓ 16 callersFunction_make_verdict
()
tests/test_v0540.py:479
↓ 16 callersFunction_pair
(prompt="p", chosen="c", rejected="r")
tests/test_v0403_part_c.py:34
↓ 16 callersFunction_raft_row
(distractors: int = 2)
tests/test_v07110.py:79
↓ 16 callersFunction_tiny_llama_dir
A real (tiny) Llama checkpoint on disk: config.json + model.safetensors.
tests/test_v07200.py:978
↓ 16 callersFunction_torch_or_skip
()
tests/test_v07121.py:32
↓ 16 callersFunction_validate_example
Validate a single generated example matches the expected format.
src/soup_cli/commands/generate.py:916
↓ 16 callersFunctionactivation_offloading_context
Wrap a trainer's ``trainer.train()`` call with activation offloading. Centralises the cwd-containment guard for ``activation_offloading="disk"``
src/soup_cli/utils/v028_features.py:161
↓ 16 callersFunctionapply_pre_lora_patches
Run pre-LoRA surgical patches (v0.39.0 Part D, multi-trainer in v0.40.6). Currently: Gemma4 ``ClippableLinear`` -> ``nn.Linear`` swap. Gated by
src/soup_cli/utils/peft_wiring.py:22
↓ 16 callersFunctionbuild_apple_adapter_plan
Build a validated :class:`AppleAdapterPlan` from raw CLI inputs.
src/soup_cli/utils/apple_adapter.py:165
↓ 16 callersFunctionbuild_prompt
Build the generation prompt for reasoning data. Args: count: Number of examples to generate. fmt: Output format (alpaca/sharegpt/
src/soup_cli/data/templates/reasoning.py:11
↓ 16 callersFunctionestimate_batch_size
Estimate max batch size that fits in GPU memory. Conservative estimate — better to start smaller and gradient accumulate.
src/soup_cli/utils/gpu.py:143
↓ 16 callersFunctionexpand_model_blocks
Insert ``num_new_blocks`` zero-init transformer layers at the end. v0.53.4 #83 — live implementation. Clones the last ``num_new_blocks`` deco
src/soup_cli/utils/block_expansion.py:93
↓ 16 callersMethodgenerate
Greedy / temperature-sampled blend generation. Returns the full seq. Single-sequence (``B == 1``): the EOS stop inspects row 0, so a batched
src/soup_cli/utils/mole_routing.py:626
↓ 16 callersMethodget_run
Get full details of a single run. Supports prefix matching.
src/soup_cli/experiment/tracker.py:279
↓ 16 callersFunctionload_dataset
Load dataset for training. Returns dict with 'train' and optionally 'val' keys. Supports: - Local files (.jsonl, .json, .csv, .parquet, .txt)
src/soup_cli/data/loader.py:209
↓ 16 callersFunctionpredict_merged_verdict
Live canary verdict for a merged adapter (v0.71.4 #172). Returns the merged adapter's OK / MINOR / MAJOR verdict by comparing per-prompt cana
src/soup_cli/utils/adapter_merge.py:547
↓ 16 callersFunctionrender_deploy_script
Render the shell script that takes the trained model to the target. The script is intentionally a stub: it prints the planned ``soup serve``
src/soup_cli/utils/deploy_autopilot.py:244
↓ 16 callersFunctionresolve_token
Return the HF token following the documented precedence. Order: 1. ``explicit`` argument (for tests / programmatic callers). 2. ``HF_TOKE
src/soup_cli/utils/hf.py:38
↓ 15 callersFunction_asr_yaml
( *, task="asr", backend="transformers", fmt="asr", asr_language=None, asr_task=None,
tests/test_v07132.py:180
↓ 15 callersFunction_create_adapter
Create a fake adapter directory with adapter_config.json.
tests/test_adapters.py:13
↓ 15 callersFunction_down_proj
Return the MLP down-projection for decoder ``layer``. Llama: ``mlp.down_proj`` (nn.Linear, weight ``[out, in]``). GPT-2: ``mlp.c_proj`` (Conv
src/soup_cli/utils/edit_kernels.py:128
↓ 15 callersFunction_load
(yaml_text: str)
tests/test_v0490.py:15
↓ 15 callersFunction_make_tiny_plan
Build a minimal blame plan for testing.
tests/test_v0660_part_b.py:474
↓ 15 callersMethod_run
(self, args, cwd)
tests/test_v07134.py:376
↓ 15 callersFunction_tokenizer
A real ``transformers`` tokenizer — so ``apply_chat_template`` is the genuine Jinja renderer, not a mock that would agree with anything. Buil
tests/test_issue332_vllm_prompt.py:45
↓ 15 callersFunction_write_jsonl
(path: Path, rows: list)
tests/test_v0716.py:29
↓ 15 callersFunction_write_jsonl
(path: Path, rows)
tests/test_v07140.py:368
↓ 15 callersFunctionapply_bank_to_serve
Apply a vector bank to a running ``soup serve`` instance (v0.71.12 #221). Reconstructs the shared projection ``P`` from ``projection_seed`` and b
src/soup_cli/utils/vector_bank.py:502
↓ 15 callersFunctionapply_gdpo_loss
Generalized DPO loss kernel (v0.53.2 #135). Three variants: * ``standard`` — closed-form DPO: ``-log σ(β·(Δπ - Δref))``. Requires refe
src/soup_cli/utils/ebft_gdpo.py:381
↓ 15 callersFunctionbf16_fp16_flags
``(bf16, fp16)`` for ``TrainingArguments`` on ``device``. bf16 where the card has it, fp16 where it does not, neither on CPU. Cannot regress
src/soup_cli/utils/gpu.py:298
↓ 15 callersFunctionbuild_assistant_only_labels
Build labels where only assistant tokens contribute to loss. Args: messages: Chat messages list (``{"role": ..., "content": ...}``).
src/soup_cli/data/loss_mask.py:109
↓ 15 callersFunctionbuild_echo_trap_callback
Build the live echo-trap HF Trainer callback (v0.71.11 #240). Lifts the v0.70.0 ``NotImplementedError`` stub. Validates every input at the pu
src/soup_cli/utils/echo_trap.py:446
↓ 15 callersFunctionbuild_meta_skeleton
Build the model structure on ``meta``: no weight storage is allocated. Under ``quant='nf4'`` the decoder linears are replaced with ``bnb.nn.L
src/soup_cli/utils/layer_stream_runtime.py:1217
↓ 15 callersFunctioncheck_quant_distributed_compat
Return a list of human-readable problem strings (empty = OK). Hard incompatibilities are emitted as plain strings; advisories use a leading `
src/soup_cli/utils/quant_menu.py:456
↓ 15 callersFunctionclassify_behavior_score
OK / MINOR / MAJOR classification on a [0, 1] score (higher better).
src/soup_cli/utils/behavior_battery.py:131
↓ 15 callersFunctioncompute_bucket_weights
Return normalised sampler weights per bucket. Buckets with no recorded samples fall back to the uniform prior. Buckets with higher mean loss
src/soup_cli/utils/curriculum_dynamic.py:225
↓ 15 callersFunctioncreate_modelfile
Generate Ollama Modelfile content. Args: gguf_path: Path to the GGUF model file. template: Template name (key in OLLAMA_TEMPLATES
src/soup_cli/utils/ollama.py:154
← previousnext →101–200 of 20,206, ranked by callers