Comments (7)
Thank you for clarifying!
from llamasharp.
var @params = new ModelParams(modelPath);
var embedder = new LLamaEmbedder(@params);
var result = embedder.GetEmbeddings("Hello");
This seems to work for me. result
is filled with a load of numbers which are presumably the embedding vector of "Hello"
from llamasharp.
I might not have explained it accurately 🥲
After creating that vector how can I use it within LlamaSharp for an existing model?
from llamasharp.
I don't think LLamaSharp itself has anything that will consume embeddings, that's usually down to your own system (e.g. an external vector database). What are you actually trying to do with the embeddings?
from llamasharp.
I'm trying to get the embedding from a text extracted from a PDF File. I want to feed it into the llm model for a QA type bot
from llamasharp.
Maybe I'm misunderstanding what you're asking, but I don't think you'd feed the embeddings into the LLM. Instead you would retrieve some text (e.g. using a vector database to find knowledge "nearby" the question embedding vector) and then feed that into the context when you ask your question. That's not something LLamaSharp does - it'll do the start (generate embeddings) and the end (run the LLM) but not the middle bit (use the embeddings to retrieve some knowledge).
I know some people have been working on higher level things (e.g. BotSharp and SemanticKernel) which may do more of what you want (I'm not very familiar with those projects, so I'm not sure)
from llamasharp.
@twentytwokhz @martindevans Here is the updated docs related to how to adpot the LlamaSharp in a high level bot framework. I'll keep update the docs and let me know if you can run it through according the latest docs.
from llamasharp.
Related Issues (20)
- Unable to load SYCL compiled backend HOT 12
- LLamaSharp runtime binaries don't support Rosetta2 HOT 7
- Split the main package
- Make `LLamaSharp.semantic-kernel` depend on `Microsoft.SemanticKernel.Core` instead of `Microsoft.SemanticKernel`. HOT 1
- [Feature]: SemanticKernel FuctionCall HOT 3
- [BUG]: When using large models with the GPU the code crashes with cannot allocate kvcache HOT 13
- Llava DLL issue in Unity HOT 2
- [BUG]: When using the output IAsyncEnumerable<string> of session.ChatAsync() strings are not streamed into client HOT 5
- Semantic Kernel - Home Automation Sample HOT 4
- Phi-3-medium-128k-instruct - error due to tensor shape expected 245, got 243 HOT 2
- [BUG]: Offset and length were out of bounds HOT 1
- Have an error then try run example "KernelMemorySaveAndLoad" HOT 1
- [Feature]: Expose implementation details of the KV Cache HOT 6
- Unable to Utilize Full CPU Capacity During Inference HOT 2
- [BUG]: Cannot load the backend on MACOS HOT 2
- [BUG]: qwen2 nvidia abnormal occurrence HOT 7
- [Feature]: AuthorRole can custom role labels be supported ?
- SEHException on Tokenize model. HOT 5
- Cannot figure out how to switch backend to OpenCL HOT 3
- [Feature]: Support JSON Schema from llama.cpp HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llamasharp.