Embedding constructor

Embedding(
  1. String path, {
  2. int? nThread,
  3. int? nThreadBatch,
  4. int? nCtx,
  5. int? nBatch,
  6. int? nGpuLayers,
  7. bool verbose = false,
})

Implementation

factory Embedding(
  String path, {
  int? nThread,
  int? nThreadBatch,
  int? nCtx,
  int? nBatch,
  int? nGpuLayers,
  bool verbose = false,
}) {
  final cStr = CharArray.from(path);
  final (model, ctx) = c.loadModel(
    cStr,
    LlamaParams(
      nThread: nThread,
      nThreadBatch: nThreadBatch,
      nCtx: nCtx,
      nBatch: nBatch,
      nGpuLayers: nGpuLayers,
      embedding: true,
    ),
  );

  return Embedding._(
    model,
    ctx,
    cStr,
    verbose,
  );
}