Obscura.Recognizer.GLiNER.Ortex (obscura v0.1.0)

Copy Markdown View Source

Optional Ortex-backed serving for GLiNER span models.

Summary

Functions

Builds an Ortex GLiNER serving from local model assets.

Flushes an enabled ONNX Runtime profile and summarizes execution-provider use.

Runs GLiNER inference for one text.

Runs GLiNER inference for many texts.

Types

t()

@type t() :: %Obscura.Recognizer.GLiNER.Ortex{
  config: term(),
  execution_providers: term(),
  model: term(),
  model_spec: term(),
  paths: term(),
  profile_prefix: term(),
  provider_metadata: term(),
  runtime_module: term(),
  tokenizer: term()
}

Functions

build(opts \\ [])

@spec build(keyword()) :: {:ok, t()} | {:error, term()}

Builds an Ortex GLiNER serving from local model assets.

finish_profiling(serving)

@spec finish_profiling(t()) :: {:ok, map()} | {:error, term()}

Flushes an enabled ONNX Runtime profile and summarizes execution-provider use.

CoreML participation proves that ONNX Runtime assigned work to CoreML. It does not prove GPU-only execution because CoreML has no GPU-only compute-unit mode.

run(serving, text, opts \\ [])

@spec run(t(), String.t(), keyword()) :: {:ok, [map()]} | {:error, term()}

Runs GLiNER inference for one text.

run_many(serving, texts, opts \\ [])

@spec run_many(t(), [String.t()], keyword()) :: {:ok, [[map()]]} | {:error, term()}

Runs GLiNER inference for many texts.