Obscura.PrivacyFilter.Checkpoint.Setup (obscura v0.1.0)

Copy Markdown View Source

Development setup helper for local native privacy-filter checkpoints.

This module is intentionally outside the analyzer runtime. It downloads model assets only when called explicitly by a Mix task or by developer tooling.

Summary

Types

download_tool()

@type download_tool() :: :curl | :hf

file_plan()

@type file_plan() :: %{
  file: String.t(),
  source: String.t(),
  url: String.t(),
  output: Path.t()
}

incomplete_checkpoint_error()

@type incomplete_checkpoint_error() :: %{
  checkpoint: Path.t(),
  repo: String.t(),
  revision: String.t(),
  layout: :native | :python_original,
  file: Path.t(),
  actual_size: non_neg_integer(),
  expected_size: non_neg_integer(),
  missing_bytes: non_neg_integer(),
  progress_percent: float(),
  resume_setup_command: String.t(),
  resume_curl_command: String.t() | nil,
  resume_hf_command: String.t() | nil
}

plan()

@type plan() :: %{
  repo: String.t(),
  revision: String.t(),
  layout: :native | :python_original,
  checkpoint: Path.t(),
  files: [file_plan()]
}

Functions

curl_command(file_plan, opts \\ [])

@spec curl_command(
  file_plan(),
  keyword()
) :: {String.t(), [String.t()]}

hf_command(setup_plan, file_plan, opts \\ [])

@spec hf_command(plan(), file_plan(), keyword()) :: {String.t(), [String.t()]}

plan(opts \\ [])

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

run(opts \\ [])

@spec run(keyword()) :: {:ok, map()} | {:error, term()}