embedding

Compute normalized text embeddings and print cosine similarity.

Usage: embedding -m embed-model.gguf [-p text] [-ngl n_gpu_layers]

The model must be an embedding model (e.g. nomic-embed-text, bge-*). If no -p is given, two built-in sentences are embedded and compared.

Members

Functions

main
int main(string[] args)
Undocumented in source. Be warned that the author may not have intended to support it.
printCosine
void printCosine(double sim)
Undocumented in source. Be warned that the author may not have intended to support it.
printEmbeddingRow
void printEmbeddingRow(string prompt, size_t idx, const(float)[] embd, int nEmbd)
Undocumented in source. Be warned that the author may not have intended to support it.
printUsage
int printUsage(string prog)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta