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

Error processing text: Error: Embed model not set when using ollama. #24

Closed
remisharrock opened this issue Jun 17, 2024 · 1 comment
Closed

Comments

@remisharrock
Copy link

remisharrock commented Jun 17, 2024

  • I'm submitting a ...
    [ ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [X ] question about how to use this project

  • Summary
    I modified the example vectordb.ts to use ollama:

const ai = axAI('ollama', {
  model: 'llama3:latest',
  url: 'http://localhost:11434'
} as AxOllamaArgs);

but got this error:

PS C:\Users\remis\ax\src\examples> bun run .\vectordb.ts
 98 | 
 99 |         // Batch upsert embeddings
100 |         await this.db.batchUpsert(embeddings);
101 |       }
102 |     } catch (error) {
103 |       throw new Error(`Error processing text: ${error}`);
                  ^
error: Error processing text: Error: Embed model not set
      at C:\Users\remis\ax\src\docs\manager.ts:103:13
  • Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Indeed in ollama i have only one model: 'llama3:latest' installed. Should I install an embedding model like explained here https://ollama.com/blog/embedding-models

But then how do I configure this model in here:

export type AxOllamaArgs = {
  model: string;
  url?: string;
  apiKey?: string;
  config?: Readonly<Omit<AxOllamaAIConfig, 'model'>>;
  options?: Readonly<AxAIServiceOptions>;
};

thanks for the help!

@dosco
Copy link
Collaborator

dosco commented Jun 20, 2024

I will set two default models on ollama in the default config but you are free to change them as below

  model: 'nous-hermes2',
  embedModel: 'all-minilm'
const ai = axAI('ollama', { model: 'nous-hermes2' , embedModel: 'mxbai-embed-large' });

@dosco dosco closed this as completed Jun 28, 2024
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

2 participants