Constrained generation always picks the first `anyOf` variant
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- swift
- Área
- machine-learning
Línea de trabajo
Start in StructuredGeneration.swift at generateNode(_:) and compare its anyOf handling with itemStartTokens(for:), which already masks array-item start tokens. Trace how sampled tokens identify a variant, including nullable unions and variants with the same initial structure; done means constrained generation can select each anyOf branch rather than always using the first.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Local models that use constrained generation (MLX, Core ML, and llama.cpp) always generate the first variant of an anyOf schema, because generateNode(_:) in StructuredGeneration.swift takes variants[0]. So a nullable union like anyOf: [person, .null] (#288) can never produce null, and a union of object types always produces the first one.
The model should choose the branch. One approach is to mask the next token to the start tokens of every variant, as itemStartTokens(for:) already does for array items, and continue with the variant whose start tokens include the sampled token. Variants that start the same way, like two object types, would need to look ahead to the first key.
- Lenguaje dominante
- Swift
- Estrellas
- 944
- Forks
- 95
- Merge medio
- 13 h 57 min
- PR fusionados (30 d)
- 60
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 huggingface/AnyLanguageModel
-
Support the Gemini Interactions API in GeminiLanguageModelPosiblemente ocupada @rizwankce la tomó hace 4 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
huggingface/AnyLanguageModel#302 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
huggingface/AnyLanguageModel#291 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
huggingface/AnyLanguageModel#210 · 5 comentarios · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
huggingface/AnyLanguageModel#114 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
huggingface/AnyLanguageModel#93 ·
Los mantenedores suelen responder en 1 día
Todos los issues de huggingface/AnyLanguageModel
Issues similares
-
install.ps1: Windows PowerShell 5.1 aborts after a successful cosign verification (NativeCommandError on 'Verified OK')Posiblemente ocupada @sly321-pixel la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
OneBusAway/onebusaway-ios#1518 ·
Los mantenedores suelen responder en 2 días
-
area: agents
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
manaflow-ai/cmux#19972 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
VerificationCodeInputField: iPad Return key clears/hides OTP fieldsPosiblemente ocupada @amansingh1207 la tomó hoy. Abiertoneeds attention
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
firebase/FirebaseUI-iOS#1407 ·
Los mantenedores suelen responder en 5 días
-
component: swift renderer P2 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
a2ui-project/a2ui#3146 ·
Los mantenedores suelen responder en 2 días