def from_env

mlbend-datasets@0.1.6.0 · main.bend:281

import mlbend-datasets@0.1.6.0/main.bend as MlbendDatasets
import Base
import mlbend-huggingface@0.1.1.0/main.bend as Hf

281def from_env(e: Result<&1, &1, U32 & String, String>, +repo: String, rev: String, +path: String,
282  header: Bool, drop: Nat) -> IO(Result<&1, &1, Hf.Err, Table>):
283  match e:
284    case Fail{code}:
285      fetch_csv(repo, rev, path, header, drop)
286    case Done{dir}:
287      do IO<Result<&1, &1, Hf.Err, Table>>:
288        m : Maybe<&1, String> <- read_cached(cached_path(dir, repo, path))
289        t : Result<&1, &1, Hf.Err, Table> <- cached_or_fail(m, repo, path, header, drop)
290        return t

Uses (16)

Used by (1)