Make TaxonomyTyper take loaded objects and add from_pretrained
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 74/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
Start with lettucedetect/detectors/taxonomy_head.py and the construction site in transformer.py:69-82; run uv run --extra dev pytest tests/test_custom_taxonomy_pytest.py -q first. Keep resolve_taxonomy and type_spans behavior intact while separating construction from loading. Done when the stub construction avoids downloads, from_pretrained records the specified version and logs model_loaded, and the existing test passes unchanged.
索引モデルが issue の本文から書いたものです。
説明
Parent: #153 · Epic: #126 · Blocked by: #151
Branch from stateless_core; open the PR against it.
Problem
TaxonomyTyper loads its own encoder and tokenizer from a name inside its constructor, so it cannot be built from objects a service already loaded and downloads on construction.
Current behavior
lettucedetect/detectors/taxonomy_head.py:49-82constructor loads the encoder and tokenizer from a name.taxonomy_head.py:21resolve_taxonomyturnsTrue, a list, a flat dict or the nested dict into(categories, subcategories).taxonomy_head.py:96type_spans(answer, context, spans)types spans.
Steps
- Change the constructor to
TaxonomyTyper(encoder, tokenizer, *, categories=None, subcategories=None, max_length=1024, model_id=None, model_version=None); no download. - Add
TaxonomyTyper.from_pretrained(model_id, *, device=None, categories=None, subcategories=None, model_version=None, **loader_kwargs); logsmodel_loaded. Version is the resolved commit for a hub id and the caller'smodel_versionfor a local path. - Keep
resolve_taxonomyand all four taxonomy forms with today's meaning. - Update the one place that constructs it (
transformer.py:69-82) to usefrom_pretrained.
Acceptance criteria
- Constructing with stub encoder/tokenizer downloads nothing.
-
from_pretrainedwith fakes records version as described and logsmodel_loaded. -
type_spansoutput unchanged;tests/test_custom_taxonomy_pytest.pypasses unchanged. - Follows CONTRIBUTING "Errors and logging".
Start here
uv run --extra dev pytest tests/test_custom_taxonomy_pytest.py -q
- 主要言語
- Python
- スター
- 615
- フォーク
- 60
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
KRLabsOrg/LettuceDetect のほかの issue
-
Stop-hook --min-confidence drops every --llm-model span (missing confidence treated as 0.0), reporting hallucinated answers as clean対応中かも @Clannad47 が 19 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
KRLabsOrg/LettuceDetect#117 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
KRLabsOrg/LettuceDetect#108 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 半日 初心者へのやさしさ 70/100
KRLabsOrg/LettuceDetect#104 ·
メンテナーはふだん 1 日以内に返信
-
ready-for-agent
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
KRLabsOrg/LettuceDetect#181 ·
メンテナーはふだん 1 日以内に返信
-
ready-for-agent
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
KRLabsOrg/LettuceDetect#180 ·
メンテナーはふだん 1 日以内に返信
KRLabsOrg/LettuceDetect の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
cunla/fakeredis-py#636 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
opensafely-core/job-server#6180 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:models enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
newrelic/newrelic-python-agent#1913 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信