Add token scores, input_truncated and usage to EncoderDetector
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend-api-design, machine-learning
Direzione di ricerca
Start with transformer.py at _decode_sample, _predict_single, the batch and predict_prompt truncation paths, and the passage-group path; run the focused pytest command in the issue. Compare token results with the #128 golden output and check usage and truncation behavior, including a log-capture test that verifies counts without input text. The issue is blocked by #149 and asks for a branch from stateless_core.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Parent: #148 · Epic: #126 · Blocked by: #149
Branch from stateless_core; open the PR against it.
Problem
The encoder can show token-level evidence only through the output_format="tokens" dict path, truncation is only logged (and not at all when a passage group still exceeds max_length), and nothing reports which weights ran or how much work a call did.
Current behavior
- Tokens:
transformer.py:163_decode_sample,:241_predict_singlewithoutput_format="tokens"(pred,probkeys). - Truncation warnings:
transformer.py:319-322(batch path, text-free but only logged) and:511-521(predict_prompt, only logged). The passage-group path (:105-125) logs nothing when a group still exceedsmax_length. - No usage.
Steps
include_tokens=True(setsupports_tokens = True) returnsDetection.tokensasTokenScore(token text, offsets into the answer,score= model probability,flagged= oldpred). Same tokens and probabilities as the old"tokens"output; not filtered bymin_score; aggregated over passage groups withmax().- When the tokenized prompt + answer exceed
max_length, or a group still exceeds it, add the warninginput_truncatedto theDetectionand log a WARNING with the code and token counts (never text). - Add
usage: one entry withmodel_id,model_version, unitssources(omitted forPromptInput),source_chars,answer_chars,input_tokens(summed over passage groups).
Acceptance criteria
- Tokens equal the #128 golden
"tokens"output field for field (pred→flagged,prob→score). - A too-long input yields
input_truncated; a log-capture test shows the code and counts and no input text. -
usagehas the listed units;sourcesabsent forPromptInput. - Contract suite still passes; existing tests pass; follows CONTRIBUTING "Errors and logging".
Start here
uv run --extra dev pytest tests/test_inference_pytest.py -q -k "truncat or token"
- Lingua principale
- Python
- Stelle
- 615
- Fork
- 60
- Merge medio
- 1g 8h
- PR unite (30g)
- 10
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di KRLabsOrg/LettuceDetect
-
Stop-hook --min-confidence drops every --llm-model span (missing confidence treated as 0.0), reporting hallucinated answers as cleanForse già presa @Clannad47 l’ha presa 18 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
KRLabsOrg/LettuceDetect#117 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
KRLabsOrg/LettuceDetect#108 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 Mezza giornata Idoneità per principianti 70/100
KRLabsOrg/LettuceDetect#104 ·
I maintainer di solito rispondono entro 1 giorno
-
ready-for-agent
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
KRLabsOrg/LettuceDetect#181 ·
I maintainer di solito rispondono entro 1 giorno
-
ready-for-agent
Difficoltà 5/5 Più di una settimana Idoneità per principianti 22/100
KRLabsOrg/LettuceDetect#180 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di KRLabsOrg/LettuceDetect
Issue simili
-
community enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
NVIDIA/auto-ontology#463 ·
I maintainer di solito rispondono entro 1 giorno
-
Update Atari link on Gymnasium docs pageForse già presa @qwist1233-cpu l’ha presa oggi. Apertahelp wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Farama-Foundation/Gymnasium#1845 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 91/100
WingedGuardian/GENesis-AGI#4101 ·
I maintainer di solito rispondono entro 1 giorno