MCPcopy Create free account

hub / github.com/MakazhanAlpamys/Soup / functions

Functions20,206 in github.com/MakazhanAlpamys/Soup

↓ 7 callersMethod_plan
(self, tmp_path, strategy)
tests/test_v07113.py:563
↓ 7 callersFunction_prm_yaml
( *, task: str = "grpo", backend: str = "transformers", modality: str = "text", prm_reward
tests/test_v07130.py:93
↓ 7 callersFunction_randomise_lora_b
PEFT initialises lora_B to ZERO, so an adapter that fails to load is byte-identical to a freshly built one and every assertion below would pass
tests/test_v07203.py:1308
↓ 7 callersFunction_read_prompts
Read prompts from a JSONL or plain text file.
src/soup_cli/commands/infer.py:625
↓ 7 callersFunction_reject_bool_int
(name: str, value)
src/soup_cli/utils/curriculum_dynamic.py:44
↓ 7 callersFunction_resolve_canonical
Match ``value`` against the union allowlist case-insensitively. Returns the canonical (original-case) entry from the allowlist or ``None`` if
src/soup_cli/utils/gguf_quant.py:163
↓ 7 callersFunction_rewrite_advise_argv
Inject `run` between `advise` and a non-subcommand first argument. Lets users type ``soup advise data.jsonl`` instead of the explicit ``soup
src/soup_cli/cli.py:579
↓ 7 callersFunction_row_to_pair
Extract (text_a, text_b) for paired ``cross_encoder`` rows. Raises: TypeError: either field present but not a string (security review M4
src/soup_cli/trainer/classifier.py:79
↓ 7 callersMethod_rows
(self, tag, count)
tests/test_v07136.py:961
↓ 7 callersMethod_runner
(self)
tests/test_v07140.py:689
↓ 7 callersMethod_setup
Point the pin DB at a tmp path and chdir so local_dir stays in cwd.
tests/test_v0712.py:534
↓ 7 callersFunction_split_command_args
Split ``argv`` into (command, remaining_args) for the audit record. Skips the program name (argv[0]) and global options. Global options that
src/soup_cli/cli.py:733
↓ 7 callersFunction_stream_cfg
(weights, out_dir, task="dpo", **training)
tests/test_v07204.py:247
↓ 7 callersFunction_strip_ansi
(text: str)
tests/test_v0560.py:64
↓ 7 callersFunction_supports_kv_cache
Capability probe: does ``model.forward`` explicitly take a KV cache? Requires BOTH ``past_key_values`` and ``use_cache`` to be declared as ex
src/soup_cli/utils/minillm.py:238
↓ 7 callersFunction_tiny_lora
()
tests/test_v07200.py:1006
↓ 7 callersFunction_torch_or_skip
()
tests/test_v07119.py:169
↓ 7 callersMethod_toy_inputs
(self, batch=2, seq=4)
tests/test_v05311.py:24
↓ 7 callersMethod_trainer
(self)
tests/test_v0403_part_b.py:162
↓ 7 callersFunction_validate_asr_row
Extract ``(audio_path, transcript)`` from an ASR row. Raises: ValueError: missing ``audio`` / ``text`` or a non-string transcript.
src/soup_cli/trainer/asr.py:86
↓ 7 callersFunction_varied_generate_fn
Stateful stub: unique instruction per call so dedup still reaches target.
tests/test_v0716.py:501
↓ 7 callersMethod_wrapper
A StreamingSetupMixin whose probe returns `peak`, with a close spy.
tests/test_issue349_measured_fit.py:156
↓ 7 callersMethod_write
(self, tmp_path, rows)
tests/test_v07136.py:532
↓ 7 callersFunction_write_adapter
(dir_path: Path, weights: dict)
tests/test_v0570_part_b.py:240
↓ 7 callersFunction_write_iteration
(iteration_id, *, served="mymodel")
tests/test_v0714.py:1008
↓ 7 callersFunction_write_tiny_model
Save a tiny CPU Llama + tokenizer to ``dir_path`` for CLI smoke.
tests/test_v07129.py:441
↓ 7 callersFunctionadd_to_collection
Add a repo to an existing HF Collection. Validates inputs and swallows "already exists" errors when ``ignore_duplicate`` is set (default) so
src/soup_cli/utils/hf.py:195
↓ 7 callersMethodadvance
(self, idx: int)
src/soup_cli/utils/layer_stream_runtime.py:579
↓ 7 callersFunctionappend_audit_event
Append one audit record to ``path``. Rotates at ``cap_bytes``. Atomic-ish append: opens with ``O_APPEND | O_CREAT`` (and ``O_NOFOLLOW`` on PO
src/soup_cli/utils/audit_log.py:241
↓ 7 callersFunctionapply_linear_probe
Per-token probe scores ``activations @ w``. ``threshold`` is validated here so callers cannot pass NaN; it is not applied to the projection (
src/soup_cli/utils/probe_kernel.py:119
↓ 7 callersFunctionapply_llama_pro_freeze
Freeze every parameter EXCEPT the appended new blocks. Returns the count of trainable parameters after freezing. Intended to be called immedi
src/soup_cli/utils/block_expansion.py:186
↓ 7 callersFunctionapply_long_context_config
Apply long-context configuration to a model config object. Args: model_config: HF model config object (mutated in place). target_
src/soup_cli/utils/long_context.py:365
↓ 7 callersFunctionattach_gdpo_compute_loss
Wrap TRL's ``DPOTrainer.dpo_loss`` so a GDPO variant is used (v0.53.2 #135). No-op when ``tcfg.gdpo_variant`` is None. Replaces the trainer's
src/soup_cli/utils/ebft_gdpo.py:229
↓ 7 callersFunctionbuild_cross_doc_mask
Build a block-diagonal causal attention mask. Args: boundaries: Sorted document boundary indices in ``[0, seq_length]`` with
src/soup_cli/utils/cross_doc_attn.py:23
↓ 7 callersFunctionbuild_linux_desktop_entry
Build a freedesktop.org `.desktop` entry.
src/soup_cli/utils/shortcuts.py:61
↓ 7 callersFunctionbuild_mii_app
Wrap a DeepSpeed-MII pipeline as a minimal OpenAI-compatible FastAPI app exposing ``/v1/chat/completions`` and ``/v1/models`` (#38, v0.33.0).
src/soup_cli/utils/mii.py:92
↓ 7 callersFunctionbuild_pairs
Produce preference pairs from ``traces`` according to ``signal``.
src/soup_cli/data/traces/pair_builder.py:84
↓ 7 callersFunctionbuild_plan
Render a TrainingPlan from a soup-config-shaped dict.
src/soup_cli/utils/terraform_plan.py:252
↓ 7 callersFunctioncitation_span_token_weights
Per-token loss weights for ``answer`` tokens, boosting citation spans. ``offsets`` is the per-token ``(start_char, end_char)`` mapping for the
src/soup_cli/utils/raft.py:161
↓ 7 callersFunctionclassify_echo_signal
Map a signal in ``[0, 1]`` to OK / WARN / TRAP. - signal in [0.0, _ECHO_OK_BAND=0.30): OK - signal in [_ECHO_OK_BAND, _ECHO_TRAP_BAND=0.60):
src/soup_cli/utils/echo_trap.py:215
↓ 7 callersFunctioncombine_signals
Multi-signal vote → a single drop_pct in ``[0, 1]``. Clamps each enabled, finite per-signal value to ``[0, 1]`` then returns their mean. Miss
src/soup_cli/utils/reward_hack_control.py:134
↓ 7 callersFunctioncompute_forget_quality
Forget Quality ∈ ``[0, 1]`` from pre/post loss on the forget set. Higher post-unlearn loss → more forgetting. Linearly ramps from 0 (post ==
src/soup_cli/utils/unlearning_eval.py:172
↓ 7 callersFunctioncompute_layer_diffs
Compute per-layer Frobenius diffs for every name in both adapters. Returns ``(per_layer, only_in_a, only_in_b)``. ``per_layer`` covers the in
src/soup_cli/utils/adapter_diff.py:121
↓ 7 callersFunctioncompute_lock_closure
Return the 64-hex closure SHA over the three input hashes. Each input must be a 64-hex SHA-256 itself. The closure is ``sha256(base_model_sha
src/soup_cli/utils/soup_lock.py:80
↓ 7 callersFunctioncompute_row_influence
DataInf-style per-row influence score. Returns ``cos(row_grad, probe_grad) × |row_grad|``. A positive score means the row's gradient is align
src/soup_cli/utils/blame.py:293
↓ 7 callersFunctioncompute_snr
Signal-to-noise ratio of a single 2-D weight matrix. Singular values above the MP threshold are "signal", the rest "noise"; ``snr = signal_su
src/soup_cli/utils/spectrum_scan.py:137
↓ 7 callersFunctionconfig_to_yaml
Convert a migration result dict to soup.yaml YAML string. Strips internal keys like _warnings before serialization.
src/soup_cli/migrate/common.py:60
↓ 7 callersFunctioncreate_sglang_runtime
Create an SGLang Runtime for serving. Args: model_path: Path to model or LoRA adapter directory. base_model: Base model ID (requi
src/soup_cli/utils/sglang.py:62
↓ 7 callersFunctionctfidf_labels
Class-based TF-IDF: each CLUSTER is one document. A term frequent in one cluster and rare across clusters scores high; a term frequent in EVE
src/soup_cli/utils/topics.py:130
↓ 7 callersFunctiondecide_performance_flags
Return perf flags for FlashAttention / Liger / gradient_checkpointing. - ``use_flash_attn`` and ``use_liger`` only enabled on Ampere or newer.
src/soup_cli/autopilot/decisions.py:327
↓ 7 callersFunctiondecoder_owner
Return the module that owns ``.layers`` (LlamaModel / Qwen2Model). This is deliberately NOT the CausalLM wrapper. PEFT's ``LoraModel.forward``
src/soup_cli/utils/layer_stream_runtime.py:45
↓ 7 callersMethoddelete
Delete an entry. FK ``ON DELETE CASCADE`` removes child rows.
src/soup_cli/registry/store.py:392
↓ 7 callersFunctiondeploy_to_ollama
Deploy a model to Ollama via `ollama create`. Args: name: Model name for Ollama. modelfile_content: Full Modelfile content.
src/soup_cli/utils/ollama.py:208
↓ 7 callersFunctiondetect_arch_name
Return the model's architecture class name, or ``None``. Probes ``model.config.architectures[0]`` first (HF convention), then falls back to `
src/soup_cli/utils/multipack_trainer.py:92
↓ 7 callersFunctiondetect_plateau
True when relative range of the last ``window`` losses < ``rel_tol``. Relative range = (max - min) / mean. If the window's mean is non-positive
src/soup_cli/utils/convergence.py:18
↓ 7 callersFunctiondtype_bytes
Bytes per element. THE single dtype-size table for layer streaming — the sharder, the planner and the trainer must not each keep their own.
src/soup_cli/utils/layer_stream.py:172
↓ 7 callersFunctioneffective_tokens_per_second
Effective tokens-per-second (LF metric). `unmasked_tokens` = total non-padding labels seen during training. Returns None when wall_clock <= 0
src/soup_cli/utils/nlg_metrics.py:237
↓ 7 callersFunctionexpandable_segments_status
``(enabled, why_not)`` for the ``expandable_segments:True`` hint. Split out from :func:`probe_expandable_segments` because the caller used to
src/soup_cli/utils/layer_stream_runtime.py:1114
↓ 7 callersFunctionextended_stats
Compute extended statistics: length distribution, token counts, languages.
src/soup_cli/data/validator.py:88
↓ 7 callersFunctionextract_layer_activations
Capture residual-stream activations at ``layer`` for ``prompts``. Registers a forward hook on the resolved layer module, runs each prompt thr
src/soup_cli/utils/live_eval.py:565
↓ 7 callersFunctionextract_prompt
Extract the teacher-facing prompt from a trace row. Handles the common trace shapes: an explicit ``prompt`` / ``input`` / ``instruction`` / `
src/soup_cli/utils/prompt_distill.py:150
↓ 7 callersFunctionextract_row_text
Canonical text-extraction for dataset rows. Mirrors ``utils/_eval_text.extract_row_text`` but adds the ``instruction`` fallback used by alpac
src/soup_cli/utils/diagnose/_common.py:84
↓ 7 callersFunctionformat_cost_usd
Render a cost for display: `$0.42`, `<$0.01`, or `—`.
src/soup_cli/utils/run_cost.py:79
↓ 7 callersFunctionformat_gate_row
Render the eval-gate status row for the live training panel (#36). Returns an empty string when ``state`` is None or empty (so the row is hid
src/soup_cli/monitoring/display.py:14
↓ 7 callersFunctionformat_verdict_rubric
Plain-text rubric: which rule fired, evidence, what flips it. Stable text output (not Rich markup) so callers can pipe to a file or a clipboa
src/soup_cli/utils/advise.py:1015
↓ 7 callersFunctiongenerate_model_card_v2
Model card v2 — enriched with eval scorecard, training config, lineage. This is the generator invoked by both ``soup push`` (manual upload) and
src/soup_cli/commands/push.py:425
↓ 7 callersFunctionget_fixture_path
Return the bundled fixture path for a benchmark, or ``None`` if not yet bundled. TOFU ships in v0.61.0 (synthetic author profile mini-set und
src/soup_cli/utils/unlearning_eval.py:447
↓ 7 callersFunctionhash_config
SHA-256 of the config dict after canonical JSON serialisation.
src/soup_cli/registry/hashing.py:25
↓ 7 callersFunctionhistory_path
Resolve the history log path, with env override + containment. Mirrors v0.36.0 ``SOUP_BATCH_CACHE_PATH`` containment: the override must sit u
src/soup_cli/utils/advise_history.py:53
↓ 7 callersFunctioningest_traces
Read a JSONL file and dispatch to the matching parser. Validates source name + path containment + null-byte rejection before any open. Caps t
src/soup_cli/utils/ingest_sources.py:450
↓ 7 callersFunctioninstall_steering_hook
Install a decode-time forward hook that adds ``strength * vector``. * ``residual`` (CAA / RepE) — a forward hook on the decoder layer adds the
src/soup_cli/utils/steering.py:675
↓ 7 callersFunctionis_attention_projection
Return True when ``fqn``'s last component names an attention projection. Defensive surface — returns False (never raises) on non-string / empty /
src/soup_cli/utils/advanced_precision.py:51
↓ 7 callersFunctionis_supported_longlora_arch
Return True if ``model_name`` is in the LongLoRA allowlist. The allowlist covers Llama / CodeLlama (Llama 3.x heritage), Mistral, Mixtral (v0
src/soup_cli/utils/longlora.py:132
↓ 7 callersFunctionlist_iterations
Return iteration ids sorted by name (timestamp-prefixed).
src/soup_cli/utils/loop_iteration.py:305
↓ 7 callersFunctionload_bank
Read + validate a bank JSON. cwd-contained, symlink-rejected.
src/soup_cli/utils/vector_bank.py:324
↓ 7 callersFunctionload_checklist_spec
Load a CheckList spec from a YAML file under cwd. Uses the shared :func:`enforce_under_cwd_and_no_symlink` helper for containment, then opens
src/soup_cli/utils/checklist_dsl.py:252
↓ 7 callersFunctionload_mole_manifest
Read + validate ``<directory>/mole_manifest.json`` (serve-side). cwd-contained + symlink-rejected + size-capped (operator-supplied path).
src/soup_cli/utils/mole_routing.py:418
↓ 7 callersFunctionload_quant_config
Load + validate a TorchAO ``--quant-config`` YAML file. Enforces (per v0.53.0 docstring contract): * Shape validation via :func:`validate_qua
src/soup_cli/utils/save_formats.py:212
↓ 7 callersFunctionload_rubric
Load a rubric YAML file with validation.
src/soup_cli/eval/judge.py:99
↓ 7 callersFunctionmake_raft_trainer_class
Build a ``Trainer`` subclass with per-token weighted-CE ``compute_loss``. Cached so repeated ``raft`` runs against the same base class share one
src/soup_cli/trainer/raft.py:202
↓ 7 callersFunctionmeasure_candidate
Score one quant candidate against the baseline. Returns a :class:`MeasureResult` with classify_delta verdict. The baseline is deterministic
src/soup_cli/utils/deploy_measure.py:260
↓ 7 callersFunctionmeasure_step_peak_bytes
Run one forward+backward at the configured shape and read the real peak. This is the #349 instrument. The pre-flight's formula is fitted and, mea
src/soup_cli/utils/layer_stream_runtime.py:989
↓ 7 callersFunctionmerge_4bit
Write a single BNB-4bit-quantized merged checkpoint. Unsloth ``merged_4bit`` / ``4bit_forced`` recipe — no dequant → merge → requant cycle. `
src/soup_cli/utils/save_formats.py:254
↓ 7 callersFunctionmerge_evidence
Render a compact ``k=v`` evidence string (≤4096 chars).
src/soup_cli/utils/diagnose/_common.py:214
↓ 7 callersFunctionmerge_ties
TIES merge: trim low magnitudes, elect majority sign, disjoint avg.
src/soup_cli/utils/adapter_merge.py:126
↓ 7 callersFunctionngram_set
Return the set of n-grams (length-n tuples) in ``text``. Empty result when the token count is < n. Capped on ``text`` size.
src/soup_cli/utils/data_score.py:113
↓ 7 callersFunctionnoise_floor_from_evidence
Parse an evidence ``noise_floor`` block back into a ``NoiseFloor``. Returns ``None`` when the key is absent (every pre-v0.73.2 evidence file).
src/soup_cli/utils/ship_verdict.py:708
↓ 7 callersFunctionoffload_context
Install saved-tensor hooks for activation offloading; remove on exit. Args: target: 'cpu' → offload to RAM; 'disk' → offload to scratch f
src/soup_cli/utils/activation_offload.py:77
↓ 7 callersFunctionpack_iteration_as_can
Pack a loop iteration as a v0.26 Soup Can + append a Registry entry. Reads ``<base_dir>/<iteration_id>/iteration.json``, pushes a Registry en
src/soup_cli/utils/loop_iteration.py:219
↓ 7 callersFunctionparse_edit_subject_target
Validate the (subject, target) pair for an edit. The subject is the prefix sentence (e.g. "Paris is the capital of France"); the target is th
src/soup_cli/utils/knowledge_edit.py:132
↓ 7 callersFunctionparse_graphql
Parse a GraphQL introspection ``dict`` (``__schema`` envelope OK). Treats every Query / Mutation field as a tool-calling endpoint.
src/soup_cli/utils/agent_forge.py:266
↓ 7 callersFunctionparse_pr_target
Parse ``"owner/repo#42"`` into ``(owner, repo, pr_number)``. Raises ``TypeError`` for non-strings and ``ValueError`` for any string that does
src/soup_cli/utils/adapter_pr.py:376
↓ 7 callersFunctionpick_best_kernel
Pick the fastest kernel combo given benchmarked timings. Args: candidates: List of dicts each with ``name`` and ``time_ms`` fields.
src/soup_cli/utils/kernel_picker.py:259
↓ 7 callersFunctionpick_top_uncertain
Pick the top-N rows by uncertainty. Stable on ties — earlier rows win to make the output deterministic.
src/soup_cli/utils/active_sampler.py:204
↓ 7 callersFunctionquantised_layer_suffixes
Per-layer short keys that ``replace_with_bnb_linear`` actually converted. Authoritative by construction — derived from the skeleton rather than f
src/soup_cli/utils/layer_stream_runtime.py:1272
↓ 7 callersFunctionread_asr_sidecar
Read the ASR decode prefix sidecar; ``{}`` when absent/unreadable. Values are shape-validated (a shared / downloaded model directory could ca
src/soup_cli/trainer/asr.py:56
↓ 7 callersFunctionread_iteration
Reload an iteration record by id.
src/soup_cli/utils/loop_iteration.py:170
↓ 7 callersFunctionread_state
Read a previously-written ``TrainingState`` JSON. Containment + symlink rejection BEFORE existence probe (mirrors v0.55.0 / v0.62.0 ordering
src/soup_cli/utils/terraform_plan.py:327
↓ 7 callersMethodrecord
Record one reward-function call. Exception-safe by contract. Completions are normalised to strings and capped at ``_MAX_COMPLETIONS``
src/soup_cli/utils/rl_signal_buffer.py:98
↓ 7 callersFunctionredact_secrets
Replace anything resembling a token with '<redacted>'.
src/soup_cli/utils/crash.py:86
← previousnext →801–900 of 20,206, ranked by callers