Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Embedding functionality #73

Open
Lenskiy opened this issue Aug 6, 2024 · 0 comments
Open

Adding Embedding functionality #73

Lenskiy opened this issue Aug 6, 2024 · 0 comments

Comments

@Lenskiy
Copy link

Lenskiy commented Aug 6, 2024

Currently Matlab access to Ollama only supports text generation, but not the embeddings.
However, adding this functionality should not be hard, here is a snippet:

url = 'http://localhost:11434/api/embeddings';
data = struct(...
        'model', 'llama3.1', ...
        'prompt', 'Llamas are members of the camelid family');
    
% Send the HTTP POST request
options = weboptions('MediaType', 'application/json');
response = webwrite(url, data, options)
disp(response.embedding)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant