Add EncoderDetector.from_pretrained with model_version
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- machine-learning
Línea de trabajo
The issue points to lettucedetect/detectors/transformer.py:62-82 and tests/test_inference_pytest.py. First read those sections and the CONTRIBUTING guidance on errors and logging, then run uv run --extra dev pytest tests/test_inference_pytest.py -q. Done means the factory loads tokenizer and model, passes the device, resolves the hub commit or preserves the local version, and logs model_loaded once at INFO; the issue is blocked by #149.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Parent: #148 · Epic: #126 · Blocked by: #149
Branch from stateless_core; open the PR against it.
Problem
A service needs one explicit place where a model name becomes a model, and a record of the exact weights that ran. Today the download happens inside the constructor and nothing records the revision.
Current behavior
lettucedetect/detectors/transformer.py:62-63loads tokenizer and model with**tok_kwargsin the constructor;:66-67device handling.- No
model_loadedlog, no commit or version.
Steps
- Add
EncoderDetector.from_pretrained(model_id, *, device=None, taxonomy_head=None, include_taxonomy=True, model_version=None, config=None, **loader_kwargs)loading tokenizer and model and constructing the detector. model_versionis the resolved Hugging Face commit for a hub id; for a local path it is the caller'smodel_version, orNone.- Log
model_loadedat INFO (model id, version, device — no customer text). - Accept
taxonomy_headandinclude_taxonomyand keep today's loading for them (transformer.py:69-82); typed spans are #154/#155.
Acceptance criteria
- With
AutoTokenizer/AutoModelForTokenClassificationreplaced by fakes (no network),from_pretrainedbuilds a working detector and passesdevicethrough. - Hub id →
model_versionis the resolved commit; local path → the caller's value orNone. -
model_loadedis logged exactly once at INFO. - Existing tests pass; follows CONTRIBUTING "Errors and logging".
Start here
uv run --extra dev pytest tests/test_inference_pytest.py -q
- Lenguaje dominante
- Python
- Estrellas
- 615
- Forks
- 60
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de KRLabsOrg/LettuceDetect
-
Stop-hook --min-confidence drops every --llm-model span (missing confidence treated as 0.0), reporting hallucinated answers as cleanPosiblemente ocupada @Clannad47 la tomó hace 18 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
KRLabsOrg/LettuceDetect#117 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
KRLabsOrg/LettuceDetect#108 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 Medio día Aptitud para principiantes 70/100
KRLabsOrg/LettuceDetect#104 ·
Los mantenedores suelen responder en 1 día
-
ready-for-agent
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
KRLabsOrg/LettuceDetect#181 ·
Los mantenedores suelen responder en 1 día
-
ready-for-agent
Dificultad 5/5 Más de una semana Aptitud para principiantes 22/100
KRLabsOrg/LettuceDetect#180 ·
Los mantenedores suelen responder en 1 día
Todos los issues de KRLabsOrg/LettuceDetect
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
igormcsouza/tether#278 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
aws-samples/sample-per-model-bedrock#803 ·
Los mantenedores suelen responder en 1 día
-
documentation p1
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
huggingface/accelerate#4511 ·
Los mantenedores suelen responder en 1 día
-
follow-up
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día