MCPcopy Create free account

hub / github.com/MakazhanAlpamys/Soup / functions

Functions20,206 in github.com/MakazhanAlpamys/Soup

↓ 11 callersMethodrecord
Record a match. `winner` ∈ {"a", "b", "draw"}. Returns the new (rating_a, rating_b).
src/soup_cli/eval/arena.py:120
↓ 11 callersFunctionrecord_repo_first_seen
Trust-on-first-use record. Returns the (possibly pre-existing) pin. If the repo was already pinned, returns the existing pin without overwrit
src/soup_cli/utils/namespace_pin.py:316
↓ 11 callersFunctionregister_dataset
Register a dataset by name.
src/soup_cli/utils/registry.py:54
↓ 11 callersFunctionresolve_deepspeed_config
Adapt a preset to the run it is about to be used for. Returns a *new* config plus human-readable notes describing every change, so the caller
src/soup_cli/utils/deepspeed.py:228
↓ 11 callersFunctionresolve_prompt_strategy
Resolve ``module.path:fn_name`` into a callable. Lazy-imports the named module via :mod:`importlib`, fetches the referenced attribute, and ve
src/soup_cli/utils/data_pipeline.py:591
↓ 11 callersFunctionresolve_trl_symbol
Return ``trl.<name>``, falling back to its ``trl.experimental`` home. The public namespace is tried FIRST, so any ``trl`` that still exports the
src/soup_cli/trainer/_trl_compat.py:51
↓ 11 callersFunctionscore_answer
Score one model ``output`` against a mini-benchmark ``answer``. MCQ letter answers are scored by extraction + exact letter match; every other
src/soup_cli/eval/forgetting.py:144
↓ 11 callersFunctionsend_telemetry_payload
POST ``payload`` to PostHog if telemetry is enabled, else no-op. Returns ``True`` on a 2xx response, ``False`` on any failure or skip. NEVER
src/soup_cli/utils/trackers.py:250
↓ 11 callersFunctionsign_attestation
Sign a payload (in-toto JSON bytes) with the chosen backend. ``ed25519`` (v0.71.2 #179) produces a real detached signature over ``payload`` u
src/soup_cli/utils/attest.py:146
↓ 11 callersMethodspec_from_shard
Shape AND dtype for ONE decoder layer, read from the shard header. The dtype is read per tensor rather than taken from ``index.dtype``: an
src/soup_cli/utils/layer_stream_runtime.py:333
↓ 11 callersMethodstart
(self, total_steps=0)
tests/test_code_review_critical.py:246
↓ 11 callersFunctionsynth_probe_lora_delta
Return ``(sft_delta, wall_clock_secs)`` for an N-step LoRA probe. When ``model`` is supplied (and torch + peft + the model load succeed) this
src/soup_cli/utils/advise.py:958
↓ 11 callersFunctionvalidate_direction
Canonicalise a conversion direction against the closed allowlist.
src/soup_cli/utils/apple_adapter.py:81
↓ 11 callersFunctionvalidate_grpo_variant
Validate and normalise a GRPO variant name. Returns the canonical (lower-cased) name on success. Raises ``ValueError`` with an actionable mes
src/soup_cli/utils/grpo_variants.py:109
↓ 11 callersFunctionvalidate_name
Raise ValueError if ``name`` is invalid for registry use.
src/soup_cli/registry/store.py:118
↓ 11 callersFunctionvalidate_ra_dit_stage
Normalise + validate an RA-DIT stage name. Returns the canonical (lowercase) form. Mirrors v0.51.0 ``validate_hub_name`` / v0.61.0 ``validate
src/soup_cli/utils/ra_dit.py:65
↓ 11 callersFunctionvalidate_rollout_backend
Validate and normalise a rollout backend name.
src/soup_cli/utils/agent_rollout.py:116
↓ 11 callersFunctionvalidate_uld_strategy
Validate and normalise a ULD strategy name. Returns the canonical (lower-cased) name. Raises ``ValueError`` on any failure.
src/soup_cli/utils/uld.py:96
↓ 10 callersMethod__init__
(self, b)
tests/test_v07116.py:193
↓ 10 callersFunction_apply_replay_overrides
Apply the ``--replay*`` flags, then RE-VALIDATE. Re-validation is the point: a CLI override must clear the same cross-validators as YAML, or
src/soup_cli/commands/train.py:148
↓ 10 callersFunction_branches_dir
Resolve the branches directory with env-var override + containment.
src/soup_cli/utils/adapter_branch.py:71
↓ 10 callersFunction_compute_distill_term
Pure tensor kernel: divergence between student and teacher logits. Both logits are ``(batch, seq, vocab)``. Temperature softens the distribut
src/soup_cli/trainer/distill.py:47
↓ 10 callersFunction_create_jsonl
Helper to create a JSONL file with sample data.
tests/test_data_sample.py:13
↓ 10 callersFunction_detect_base_model
Read base_model_name_or_path from adapter_config.json.
src/soup_cli/commands/export.py:367
↓ 10 callersFunction_ensure_vision_processor_pad_token
Mirror a vision processor's nested-tokenizer token surface onto itself. HF vision processors (Idefics3/SmolVLM, LLaVA, Qwen2-VL, ...) keep the te
src/soup_cli/trainer/sft.py:49
↓ 10 callersFunction_fail
Print a friendly red error and raise ``typer.Exit(code)``.
src/soup_cli/commands/ship.py:117
↓ 10 callersFunction_is_json_container
Valid JSON that parses to an object or array. A bare scalar (``"42"``, ``"true"``) is valid JSON yet is not the structured object/array the f
src/soup_cli/eval/gate_suites.py:361
↓ 10 callersFunction_load
(yaml_str)
tests/test_v07134.py:587
↓ 10 callersFunction_make_base_yaml
(tmp_path: Path)
tests/test_v0535.py:374
↓ 10 callersFunction_make_env_lock
(*, version="2.1.0", created_at="2026-01-01T00:00:00+00:00")
tests/test_v0640_part_c.py:435
↓ 10 callersMethod_make_model
Create a mock model with given config attributes.
tests/test_moe.py:22
↓ 10 callersMethod_make_wrapper_with_mock_trainer
Helper: return an EmbeddingTrainerWrapper with trainer pre-injected.
tests/test_embedding.py:480
↓ 10 callersMethod_make_wrapper_with_mock_trainer
Helper: return a PretrainTrainerWrapper with trainer pre-injected.
tests/test_pretrain.py:476
↓ 10 callersFunction_minimal_grpo_yaml
(**overrides: object)
tests/test_v0533.py:30
↓ 10 callersMethod_mod
(self, mod_name)
tests/test_v0718.py:745
↓ 10 callersFunction_panel_text
(verdict)
tests/test_v07302.py:1203
↓ 10 callersFunction_parse_judge_url
Split a ``judge_model`` URL into ``(provider, model, api_base)``. Examples: ``ollama://llama3.1`` -> ("ollama", "llama3.1", None) ``h
src/soup_cli/eval/gate.py:169
↓ 10 callersMethod_plan
(self, raw: dict)
tests/test_v0716.py:110
↓ 10 callersFunction_requires_train_extra
()
tests/test_issue353_seed_every_task.py:34
↓ 10 callersMethod_resolve_mixed_precision
Return ``(bf16, fp16)`` flags for TrainingArguments. - When ``tcfg.auto_mixed_precision`` is True: query GPU compute capability and
src/soup_cli/trainer/sft.py:794
↓ 10 callersMethod_run
( self, tmp_path, monkeypatch, *, free_ram, stream_source, disk_kind="nvme", device="cpu", ext
tests/test_v07203.py:873
↓ 10 callersFunction_run_single
Run a single training with modified parameters.
src/soup_cli/commands/sweep.py:331
↓ 10 callersMethod_scores
(self)
tests/test_v0560.py:146
↓ 10 callersFunction_write_adapter
Write a two-tensor LoRA adapter, optionally through torch.compile's prefix. Module-level so #351's checkpoint tests below build the file the same
tests/test_v07300.py:509
↓ 10 callersFunction_write_peft_adapter
Write a synthetic PEFT LoRA adapter; return its arrays.
tests/test_v07121.py:1014
↓ 10 callersFunction_write_tasks
Write a 2-row JSONL eval task file.
tests/test_v0531_109.py:96
↓ 10 callersFunctionaggregate_step_scores
Fold per-step scalar scores into a single reward. ``mode`` is one of ``AGGREGATE_MODES``. Empty ``scores`` → 0.0. Non-finite per-step values
src/soup_cli/utils/prm_reward.py:92
↓ 10 callersFunctionalign_token_sequences
Align student token positions to teacher token positions. Returns ``list[list[int]]`` — for each student position, the (sorted) list of teach
src/soup_cli/utils/uld.py:372
↓ 10 callersFunctionapply_hub_to_cli_model
Resolve ``(model, base_model)`` after an optional non-HF hub prefetch. v0.53.10 #152 — shared CLI helper for chat / serve / infer / merge / e
src/soup_cli/utils/hubs.py:748
↓ 10 callersFunctionapply_variant_loss
Compute the per-batch loss tensor for a GRPO variant (v0.53.11 #123). This is the live kernel that lifts the v0.50.0 ``NotImplementedError``
src/soup_cli/utils/grpo_variants.py:187
↓ 10 callersFunctionatomic_write_bytes
Atomically write ``data`` (bytes) to ``output_path`` under cwd containment. Binary sibling of :func:`atomic_write_text` (v0.71.3 #181 — used by t
src/soup_cli/utils/paths.py:122
↓ 10 callersFunctionbleu_score
Corpus-level BLEU (single reference per prediction). Returns score in [0.0, 1.0]. Empty corpus returns 0.0. `smooth=True` (default) uses Che
src/soup_cli/utils/nlg_metrics.py:49
↓ 10 callersFunctionbuild_4d_attention_mask
Build a ``(B, 1, S, S)`` additive attention mask from segment IDs. Args: seq_pos_ids: integer array of shape ``(B, S)`` where entry
src/soup_cli/utils/neat_packing.py:103
↓ 10 callersFunctionbuild_chat_prompt
Render chat messages into a prompt string (#332). THE single prompt builder shared by ``soup serve``'s transformers and vLLM backends, so the
src/soup_cli/utils/vllm.py:66
↓ 10 callersFunctionbuild_cmaes_plan
Validate inputs and return a frozen ``CmaesPlan``. - ``adapters`` must contain ≥2 unique paths, all under cwd. - ``eval_suite`` must be a rea
src/soup_cli/utils/cmaes_merge.py:229
↓ 10 callersFunctionbuild_mcq_prompt
The prompt actually sent to the model for one mini-benchmark item. Adds ``_MCQ_ANSWER_CUE`` for multiple-choice items and returns ``question``
src/soup_cli/eval/forgetting.py:82
↓ 10 callersFunctionbuild_server
Build a low-level MCP :class:`Server` that dispatches to ``specs``. Each tool result is a plain ``dict`` from the handler; it is sanitized (C
src/soup_cli/mcp_server/server.py:25
↓ 10 callersFunctioncheck_budget
Decide whether to proceed with another iteration. The decision composes three checks in this order: 1. Run-cap (daily) — fast rejection when
src/soup_cli/utils/loop_budget.py:65
↓ 10 callersFunctionclassify_canary
OK / MINOR / MAJOR — the single source of truth for the verdict. The verdict asks whether MORE canaries look memorized than chance alone expl
src/soup_cli/utils/canary.py:284
↓ 10 callersFunctionclassify_sleeper_score
OK if rate <= 1%, MINOR if <= 5%, MAJOR otherwise. Boundary semantics chosen so the boundary value lands in the MORE SEVERE bucket (i.e. exac
src/soup_cli/utils/sleeper_probe.py:324
↓ 10 callersFunctionclassify_unlearn_score
Map ``score in [0, 1]`` to OK / MINOR / MAJOR verdict.
src/soup_cli/utils/unlearning_eval.py:122
↓ 10 callersFunctioncompute_coverage
Compare the suite's scorer mix to the taxonomy's recommended set. The task category is validated against v0.54.0 :data:`TASK_CATEGORIES` so t
src/soup_cli/utils/eval_lock_coverage.py:145
↓ 10 callersMethodcompute_ratings
Compute Elo ratings from all judgments.
src/soup_cli/eval/human.py:46
↓ 10 callersFunctioncompute_rm_ensemble_divergence
Mean pairwise variance across a small RM ensemble. Input is a sequence of per-RM score lists; every inner list must be the same length (one s
src/soup_cli/utils/reward_hacking.py:179
↓ 10 callersFunctionextract_top_domains
Count URL domains across ``rows`` and return the top-N by share. Returns a tuple of ``(domain, share)`` where ``share`` is the domain's fract
src/soup_cli/utils/annex_xi.py:377
↓ 10 callersFunctionfit_difficulty
Fit per-item Rasch difficulty from a flat list of {item_id, correct}. The closed-form estimate when ability is centred at 0 is ``β̂_i = -log(
src/soup_cli/utils/irt.py:174
↓ 10 callersMethodget_artifacts
(self, entry_id: str)
src/soup_cli/registry/store.py:507
↓ 10 callersFunctionget_global_tool_buffer
Return the process-wide tool-output buffer.
src/soup_cli/utils/tool_outputs.py:183
↓ 10 callersFunctioninspect_can
Load and validate the manifest from a ``.can`` file. Refuses paths outside the current working directory so an ``inspect`` invocation cannot
src/soup_cli/cans/unpack.py:24
↓ 10 callersFunctioninstantiate_trainer_plugins
v0.53.6 #105 / v0.53.7 — instantiate live upstream callbacks. Validates ``names`` against :func:`validate_trainer_plugin_list`, then lazy-imp
src/soup_cli/utils/trainer_plugins.py:217
↓ 10 callersFunctionload_eval_design
Read a design JSON back into :class:`EvalDesign`. Cwd-contained.
src/soup_cli/utils/eval_design.py:331
↓ 10 callersFunctionload_template
Resolve a template name to its YAML body. Returns None if unknown. Order: 1. YAML file in this directory (per ``manifest.json``). 2.
src/soup_cli/templates/__init__.py:62
↓ 10 callersFunctionmake_cache_key
Stable string key for the cache. Hashed for filesystem safety.
src/soup_cli/utils/batch_probe.py:144
↓ 10 callersFunctionmerge_task_arithmetic
Signed task-vector combine over the intersection of tensor names. Per adapter ``i`` and tensor ``k`` the effective factor coefficient is :fun
src/soup_cli/utils/adapter_arithmetic.py:215
↓ 10 callersFunctionmsprt_step
Run a single mSPRT decision step. Returns ``MsprtVerdict`` with one of: - ``continue``: keep collecting samples - ``reject_h0``: differen
src/soup_cli/utils/ab_test.py:160
↓ 10 callersFunctionparse_budget
Parse a budget string (``60s`` / ``5m`` / ``2h`` / bare seconds).
src/soup_cli/utils/blame.py:83
↓ 10 callersFunctionparse_spec
Parse a spec dict with optional explicit ``kind`` override.
src/soup_cli/utils/agent_forge.py:365
↓ 10 callersFunctionpick_best
Pick the fastest candidate whose score >= min_score. Tie-break: first-encountered (stable, matches v0.28.0 kernel_picker). Raises ValueError
src/soup_cli/utils/auto_quant.py:69
↓ 10 callersFunctionpost_pr_comment
Post ``body`` as a comment on the GitHub PR named by ``target``. Uses ``gh api`` (no PyGithub dependency) with the body sent over JSON stdin
src/soup_cli/utils/adapter_pr.py:414
↓ 10 callersFunctionprompt_length_kwargs
``{'max_prompt_length': N}`` iff this trl's config still accepts it. Returns an empty dict on a trl that removed the field, which is the whole
src/soup_cli/trainer/_trl_compat.py:108
↓ 10 callersFunctionprune_traces
Read a JSONL of {prompt, output} rows, strip shared prefix, write. Returns a :class:`PrunePromptReport` summarising the pass. Output JSONL co
src/soup_cli/utils/prune_prompt.py:267
↓ 10 callersFunctionread_audit_tail
Read the last ``limit`` audit records (newest last).
src/soup_cli/utils/audit_log.py:294
↓ 10 callersMethodrecord
(self, bucket: str, ok: bool)
src/soup_cli/utils/canary_router.py:141
↓ 10 callersMethodrecord
Record a new checkpoint eval.
src/soup_cli/eval/checkpoint_intelligence.py:91
↓ 10 callersFunctionrender_mask_preview
Render up to ``n`` rows with per-token trained/masked colouring. Routes to the REAL collator path per format: RAFT rows go through ``utils.ra
src/soup_cli/utils/data_doctor.py:859
↓ 10 callersFunctionrender_modal_stub
Render the Modal app stub for ``config_yaml`` (v0.71.18 #16). ``config_yaml`` is base64-embedded as data (no interpolation). ``gpu`` is valid
src/soup_cli/cloud/modal.py:131
↓ 10 callersFunctionresolve_drop_count
Resolve the block **count** from exactly one of ratio / explicit count. ``drop_layers = round(drop_ratio * num_layers)`` when a ratio is given.
src/soup_cli/utils/shrink.py:227
↓ 10 callersFunctionresolve_endpoint
Return the active endpoint for ``hub`` after env-override + validation. Looks up the per-hub env var (e.g. ``MODELSCOPE_ENDPOINT``) — if set, run
src/soup_cli/utils/hubs.py:181
↓ 10 callersFunctionresolve_stream_dtype
The store/compute dtype for a streamed run, chosen from the CARD. Until v0.73.x this was the literal ``"bfloat16" if on_cuda else "float32"``
src/soup_cli/utils/layer_stream.py:184
↓ 10 callersFunctionrun
Entry point with friendly error handling.
src/soup_cli/cli.py:804
↓ 10 callersFunctionrun_delinearize
Run the live Llama-4 expert delinearization described by ``plan``. Live since v0.71.21 (#97). ``num_experts`` defaults to the value read from
src/soup_cli/utils/delinearize_llama4.py:277
↓ 10 callersFunctionrun_doctor
Run the full chat-template compat report over a sample of ``raw_rows``. ``train_on_responses_only``/``train_on_messages_with_train_field`` pick
src/soup_cli/utils/data_doctor.py:656
↓ 10 callersFunctionrun_gate
Run every task in ``suite`` and return an aggregate verdict. ``generate_fn`` accepts a prompt and returns the model output. Injecting this ke
src/soup_cli/eval/gate.py:304
↓ 10 callersFunctionscore_forgetting
Score forgetting from per-task base + adapter accuracies. ``tolerance`` is the per-task accuracy drop considered "no regression"; defaults to
src/soup_cli/utils/diagnose/forgetting.py:19
↓ 10 callersMethodsnapshot
Return a copy of the latest `limit` records (None = all).
src/soup_cli/utils/tool_outputs.py:106
↓ 10 callersFunctionstream_arch_of
Return the streaming architecture family, or raise naming the allowlist. Mirrors ``utils/shrink.arch_family_of_config`` — an allowlist, not a
src/soup_cli/utils/layer_stream.py:217
↓ 10 callersFunctiontag_sub_sequences
Convert document boundaries into per-token 1-indexed segment IDs. Example: ``[0, 3, 5, 9]`` (3 docs of length 3, 2, 4) → ``[1, 1, 1, 2, 2, 3,
src/soup_cli/utils/neat_packing.py:36
↓ 10 callersFunctionvalidate_base_for_probe
Validate a base model name against the bundled probe catalogue. Case-insensitive: returns the canonical entry that matches.
src/soup_cli/utils/sleeper_probe.py:225
↓ 10 callersFunctionvalidate_local_rl_train_method
(name: object)
src/soup_cli/utils/local_rl.py:83
↓ 10 callersFunctionvalidate_long_context_grpo_compat
Schema-time gate for ``long_context_grpo=True``. Rejects on: - non-GRPO task (long_context_grpo only meaningful for RL rollouts); - mlx b
src/soup_cli/utils/grpo_long_context.py:37
← previousnext →401–500 of 20,206, ranked by callers