You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and i found LLamaPoolingType has Rank item, that means we can use LLamaSharp to rerank?
API & Usage
the example: ./llama-embedding.exe --model jina-reranker-v1-tiny-en-FP16.gguf -p "what is panda?hi\nwhat is panda?it's a bear\nwhat is panda?The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear or simply panda, is a bear species endemic to China." -ngl 99 -c 0 --pooling rank --embd-normalize -1 --verbose-prompt
var parameters = new ModelParams(modelPath)
{
Embeddings = true,
PoolingType = LLama.Native.LLamaPoolingType.Rank,
ContextSize = 0,
BatchSize = 2048,
UBatchSize = 2048,
GpuLayerCount = gpuLayerCount // How many layers to offload to GPU. Please adjust it according to your GPU memory.
};
var weights = LLamaWeights.LoadFromFile(parameters);
this._reranker = new LLamaEmbedder(weights, parameters);
var scores = (await this._reranker.GetEmbeddings(input, token)).Single();
result:
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Background & Description
from llama_cpp pr 9510, rerank has been supportted using pool=rank
and i found LLamaPoolingType has Rank item, that means we can use LLamaSharp to rerank?
API & Usage
the example: ./llama-embedding.exe --model jina-reranker-v1-tiny-en-FP16.gguf -p "what is panda?hi\nwhat is panda?it's a bear\nwhat is panda?The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear or simply panda, is a bear species endemic to China." -ngl 99 -c 0 --pooling rank --embd-normalize -1 --verbose-prompt
output:
How to implement
use LLamaSharp:
result:
The text was updated successfully, but these errors were encountered: