Skip to content

Commit

Permalink
fix: fallback to ollama if model is not locally available (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
laktek authored Apr 22, 2024
1 parent f8dfb56 commit 6bacace
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/sb_ai/ai.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ class Session {
this.model = model;
this.is_ollama = false;

this.inferenceAPIHost = core.ops.op_get_env('AI_INFERENCE_API_HOST');
if (model === 'llama2' || model === 'mixtral' || model === 'mistral') {
this.is_ollama = !!this.inferenceAPIHost; // only enable ollama if env variable is set
} else {
if (model === 'gte-small') {
core.ops.op_sb_ai_init_model(model);
} else {
this.inferenceAPIHost = core.ops.op_get_env('AI_INFERENCE_API_HOST');
this.is_ollama = !!this.inferenceAPIHost; // only enable ollama if env variable is set
}
}

Expand Down

0 comments on commit 6bacace

Please sign in to comment.