Skip to content

GLiFormer adapter: hardening follow-ups from #375 #378

Description

@svonava

Hardening follow-ups for the GLiFormer adapter, from the review of #375. None of them block it.

  • Explicit dtype in the load-time decoding check. _verify_bounded_decoding builds its synthetic tensors with the process default dtype. If a process sets the default to float64, the check reports a mismatch and the load fails. Build the inputs as torch.float32.
  • Look up decode allowances through batch_origin. Allowances are currently indexed by batch row. That is correct only while the adapter produces one group per document, which is true today. Map rows through batch_origin so the allowance still follows its document if that ever changes.
  • Bound output text by characters, not only by words. The per-document caps on record and relation text count words, and a single word can be very long. Add a character bound so the response size per document stays predictable.
  • Items with a required field the model didn't extract. These return an error after the full forward pass has run. Decide whether they should bill the forward pass like any other decoded item, or return the partial record with the missing field marked.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions