Commit Graph

196 Commits

Author SHA1 Message Date
Philipp Emanuel Weidmann 26ea30e117 fix: use binary mode for hashes everywhere 2026-06-27 13:22:32 +05:30
Vinay Umrethe c6f1f34a63 feat: add hashes for Windows (#394)
* fix: Hash on windows

* trigger ci

* fix: prefer .yaml (used widely than .toml for model configs)

* use removeprefix

* docs: restore commet

* use removeprefix again

* tests: Add windows hash files for all test models

* trigger ci

* fix: minor cleanup

* clean merge mismatch

* remove unnecessary CRLF replace, now that we support more SUMS files
2026-06-27 12:57:47 +05:30
Philipp Emanuel Weidmann ce355f98c8 feat: add test output hashes for CI (alternative environment) 2026-06-26 20:08:30 +05:30
Philipp Emanuel Weidmann 33833aeec2 feat: add test output hashes for CI 2026-06-26 20:00:39 +05:30
Philipp Emanuel Weidmann 9b85b7052c feat: support multiple valid hashes for each output file 2026-06-26 19:50:58 +05:30
Philipp Emanuel Weidmann 19f3ce3108 fix: revert environment changes 2026-06-25 18:29:17 +05:30
Philipp Emanuel Weidmann 13e464716f experiment: try to standardize test environment 2026-06-25 18:22:18 +05:30
Philipp Emanuel Weidmann 47cd3b16f2 feat: print additional information 2026-06-25 18:07:34 +05:30
Philipp Emanuel Weidmann faf3c154aa feat: print PyTorch config when running tests 2026-06-25 17:51:04 +05:30
Philipp Emanuel Weidmann 3abe88c39f Merge branch 'master' into e2e-tests 2026-06-23 11:38:55 +05:30
Philipp Emanuel Weidmann 4338d28cef fix: replace home-cooked set_seed function with Transformers builtin 2026-06-23 11:32:49 +05:30
Philipp Emanuel Weidmann 9f2045ccaa ci: fix test output ordering 2026-06-23 10:47:36 +05:30
Philipp Emanuel Weidmann 03e9514024 ci: run tests in CI 2026-06-23 10:33:33 +05:30
Philipp Emanuel Weidmann 8593a5b416 feat: add end-to-end tests 2026-06-23 10:18:34 +05:30
Philipp Emanuel Weidmann 9b323a1aba fix: prevent infinite loops 2026-06-21 16:01:28 +05:30
Philipp Emanuel Weidmann 4d6e0032e4 feat: support headless operation (no interactive input) 2026-06-19 11:39:02 +05:30
UmranPros 3f68a0d4e5 fix: resolve UnicodeEncodeError on Windows during model evaluation (#389)
* fix: ensure utf-8 encoding for standard output and error to prevent UnicodeEncodeError on Windows

* fix: address bot review feedback

* refactor: deduplicate stream reconfiguration loop
2026-06-18 18:16:43 +05:30
Rocker Zhang 00185db9fc feat: let the optimizer disable MLP ablation via a 0 max_weight floor (#387)
* feat: let the optimizer disable MLP ablation via a 0 max_weight floor

The MLP max_weight lower bound was 0.8 for every component, so the optimizer
always applied at least 0.8x MLP ablation and could never turn it off, even
when ablating the MLP is pure collateral damage. Give the MLP a 0 lower bound
so the optimizer can disable it per model; attention keeps the 0.8 floor.

See #202.

* perf: skip the abliteration decomposition when the weight is 0

With a 0 max_weight the component's ablation is a no-op, and reset_model()
has already left the adapter at identity. Abort that layer/component before
the decomposition, which avoids the wasted work (and the degenerate
zero-matrix decomposition raised in review on #387).

* fix: clamp a negative MLP max_weight floor so 0 is reachable

A continuous suggest_float never samples exactly 0, so a 0 lower bound could
not actually disable the MLP. Use a small negative lower bound and clamp with
max(0, ...), which puts finite probability mass on exactly 0.
2026-06-18 13:44:45 +05:30
Philipp Emanuel Weidmann e218c30e8c fix: remove notebook input shims
Closes #280
2026-06-18 13:39:26 +05:30
Petre 554a58aa0f fix: correct total trial count when adding additional trials (#385)
When a study is cancelled mid-way and the user selects 'Run additional
trials', settings.n_trials was incremented by n_additional_trials,
accumulating the original total into the new count. E.g. cancelling 200
trials at 30 and adding 10 gave n_trials=210 instead of 40, causing
'Running trial 31 of 210...' and planning 180 more trials instead of 10.

Fix by recalculating n_trials from actual completed trials + additional,
so the total reflects the new intended target, not the old one.

Fixes #379

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-17 14:58:40 +05:30
dependabot[bot] b186d6c28e build(deps): bump aiohttp from 3.13.4 to 3.14.1 (#386)
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.14.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-17 14:44:20 +05:30
Philipp Emanuel Weidmann 6ea3b8d778 build: bump version to 1.4.0 v1.4.0 2026-06-14 16:37:45 +05:30
Philipp Emanuel Weidmann 6757ada999 fix: minor cleanups and improvements 2026-06-13 19:48:38 +05:30
Philipp Emanuel Weidmann 2fd163f5e4 feat: automatically reproduce model from reproduce.json (#326)
* feat: load reproduction information

* feat: check reproduction environment against original environment

* fix: remove `trust_remote_code` setting

This improves security when running Heretic with an untrusted config file. The prompt is now always shown.

This is NOT a breaking change, because we currently ignore values for unknown settings, so existing configs continue to work.

* feat: reproduce model from JSON file

* feat: verify hashes of uploaded weight files

* fix: fix issues in automatic reproduction system (#352)

* fix: Check if a model is gated / accessible

* fix: handle unknown gated models

* feat: Auto install requirements

* simplify

* Revert "simplify"

This reverts commit 10287926e9.

* Revert "feat: Auto install requirements"

This reverts commit f4be1abd04.

* fix: Seed pytorch method

* reference, style

* simplify token

* feat: Export strategy in reproduce.json, v2

* style: Name

* simplify export strategy

* style: Rename

* enumeration

* maybe remove seed as well

* fix: don't lock settings with permanent strategy

* simplify no choice, use try/finally block

* feat: verify hashes of locally saved weight files

* fix: remove obsolete code from merge

* docs: add automatic reproduction instructions to reproduce README

---------

Co-authored-by: Vinay-Umrethe <vinayumrethe99@gmail.com>
2026-06-11 14:49:28 +05:30
UmranPros e735203d56 fix: make reset_model null-safe to handle study cancellations (#77) (#367)
* fix: make reset_model null-safe to handle study cancellations (#77)

* fix: address bot review, use nested getattr and fallback to settings dtypes

* fix: address maintainer review comments in model.py

* fix: address maintainer review feedback on reset_model

* fix: update Model.dtype type annotation to torch.dtype

* chore: revert pyproject.toml and uv.lock changes
2026-06-11 11:05:58 +05:30
UmranPros ed14dd14ca fix: improve exception formatting (#146) (#363)
* fix: fall back to exception class name when string representation is empty (#146)

* fix: walk stacktrace and causal chain to extract exception details in format_exception

* fix: fall back to complete stacktrace when exception has no message, as suggested by maintainer

* fix: address maintainer review, push newline control to printing boundaries
2026-06-09 08:27:25 +05:30
UmranPros 1a9d01c002 fix: count all trials, not just completed trials (#357) 2026-06-07 09:15:14 +05:30
Vinay-Umrethe c9ce36ddde style: remove annoying gray bg from logo (#359) 2026-06-07 08:33:40 +05:30
dependabot[bot] d68a41fb54 build(deps): bump pyarrow from 22.0.0 to 23.0.1 (#358)
Bumps [pyarrow](https://github.com/apache/arrow) from 22.0.0 to 23.0.1.
- [Release notes](https://github.com/apache/arrow/releases)
- [Commits](https://github.com/apache/arrow/compare/apache-arrow-22.0.0...apache-arrow-23.0.1)

---
updated-dependencies:
- dependency-name: pyarrow
  dependency-version: 23.0.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-06 18:18:04 +05:30
UmranPros a3dbfd21e6 fix: resolve variable shadowing of error in ValidationError handler (#356) 2026-06-05 20:16:26 +05:30
zaakir 61c59f7227 feat: save processor for multimodal models (#353)
* feat: save processor for multimodal models

VL models load via AutoModelForImageTextToText, but only the tokenizer was
saved/pushed, dropping the processor's image/audio preprocessing config.
Save/push it alongside the tokenizer so multimodal models stay complete.

* Update src/heretic/model.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Adjusted processor type to use ProcessorMixin

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-06-05 19:41:45 +05:30
MoonRide303 46b5ced274 feat: add support for gemma-4-12B-it (#350) 2026-06-04 18:20:46 +05:30
Philipp Emanuel Weidmann c62e10d570 fix: install kernels as a Transformers extra
Fixes #343
2026-06-04 12:17:35 +05:30
Ashar 906d96f78a feat: add support for LiquidAI/LFM2.5 models (#344)
* feat: add support for LiquidAI/LFM2.5 models

* add lint supress and obey gemini

Signed-off-by: coder3101 <ashar786khan@gmail.com>

* ci: format code

Signed-off-by: Ashar <ashar786khan@gmail.com>

---------

Signed-off-by: coder3101 <ashar786khan@gmail.com>
Signed-off-by: Ashar <ashar786khan@gmail.com>
2026-06-03 17:58:05 +05:30
UnstableLlama b79aa717c6 feat: add config.nohumor.toml (#340)
* feat: add config.nohumor

* Update config.nohumor.toml

Following style guide

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update config.nohumor.toml

Reduced initial comments

---------

Co-authored-by: UnstableLlama <randomnotrealemail@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-05-31 15:26:40 +05:30
Rocker Zhang db07814a97 build(deps): remove unused hf-transfer dependency (#338)
hf-transfer is declared in pyproject.toml but never activated: nothing in
the codebase sets HF_HUB_ENABLE_HF_TRANSFER, and downloads go through
from_pretrained / hf_hub_download with no transfer toggle. huggingface-hub
is pinned ~=1.7, where Xet is the default transfer backend, so hf-transfer
is dead weight and only surfaces a deprecation warning.
2026-05-31 15:16:31 +05:30
Rocker Zhang b790094193 feat: support plain text files as prompt datasets (#337)
A dataset path that points to a plain file is now read as one prompt per
line, with empty lines ignored. For text files, "column" is ignored and
"split" is optional; when given, it selects a subset of lines using slice
notation (e.g. "[:400]").

Detection uses os.path.isfile so files without an extension also work. The
split-parsing logic is factored into a shared get_split_slice helper, which
derives the split name from the specification, and split/column are now
optional in DatasetSpecification, with the dataset branches raising a clear
error when either is missing. An invalid split raises instead of being
silently ignored.

A bare slice does not parse with the pinned datasets version, since
ReadInstruction.from_spec expects a named split, so the text branch prepends
a synthetic split name.

Revives the approach from #103.

Closes #98.

Co-authored-by: Ric <ricyoung@gmail.com>
2026-05-31 15:06:47 +05:30
kabachuha 6338e2c99b feat: add "disclaimer" to the prohibited strings list (#334)
* add "disclaimer" to the prohibited strings list

The favorite Gemma's word.

* add "disclaimer" to config.py refusal markers
2026-05-28 17:36:30 +05:30
dependabot[bot] 4dcacb5eba build(deps): bump urllib3 from 2.6.3 to 2.7.0 (#328)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.6.3 to 2.7.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.6.3...2.7.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.7.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-22 15:00:08 +05:30
dependabot[bot] b8d2c5a7e9 build(deps): bump idna from 3.11 to 3.15 (#327)
Bumps [idna](https://github.com/kjd/idna) from 3.11 to 3.15.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.md)
- [Commits](https://github.com/kjd/idna/compare/v3.11...v3.15)

---
updated-dependencies:
- dependency-name: idna
  dependency-version: '3.15'
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-22 14:56:21 +05:30
Philipp Emanuel Weidmann 4e3a3a78a3 docs: update README 2026-05-22 14:51:24 +05:30
iuyua9 551db26bb7 fix: recognize root Hugging Face repo IDs (#325)
* fix: recognize root Hugging Face repo IDs

* fix: propagate invalid HF repo ids

* fix: match transformers local path precedence
2026-05-16 09:19:15 +05:30
dependabot[bot] 8b5b85bec9 build(deps): bump mako from 1.3.11 to 1.3.12 (#323)
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.3.11 to 1.3.12.
- [Release notes](https://github.com/sqlalchemy/mako/releases)
- [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES)
- [Commits](https://github.com/sqlalchemy/mako/commits)

---
updated-dependencies:
- dependency-name: mako
  dependency-version: 1.3.12
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-09 15:19:28 +05:30
anrp 1b4851536d fix: Reset model after saving merged model (#321)
* fix: Reset model after saving merged model

The adapter is lost and writes 0-byte adapters if you save an adapter after saving the merged model.

* Revert "Revert "Revert "fix: disable LoRA export for now" (#308)" (#319)"

This reverts commit 216c089974.

* Add comment as to why resetting model is needed
2026-05-09 15:16:26 +05:30
Philipp Emanuel Weidmann b2bdc1f9d6 feat: add functionality for collecting reproduce.json files from Hugging Face 2026-05-07 18:33:50 +05:30
Philipp Emanuel Weidmann 9b7624ddfa build: bump version to 1.3.0 v1.3.0 2026-05-05 18:22:02 +05:30
Philipp Emanuel Weidmann 0e7c14d94a fix: minor cleanups and improvements 2026-05-04 22:11:14 +05:30
Philipp Emanuel Weidmann 02ce8ad079 chore: update dependencies 2026-05-03 19:25:36 +05:30
Philipp Emanuel Weidmann 79ea9ce905 docs: update README 2026-05-03 09:08:57 +05:30
Philipp Emanuel Weidmann 216c089974 Revert "Revert "fix: disable LoRA export for now" (#308)" (#319)
This reverts commit da92f745de.
2026-05-03 07:25:00 +05:30