Skip to content

Commit

Permalink
chore(ai-help): stop generating ada embeddings (#11630)
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner authored Aug 15, 2024
1 parent 5ac69b2 commit 5144908
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/ai-help-macros.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from "@mdn/browser-compat-data/types";
import { h2mSync } from "../markdown/index.js";

const EMBEDDING_MODEL = "text-embedding-ada-002";
const EMBEDDING_MODEL = "text-embedding-3-small";
const EMBEDDING_MODEL_NEXT = "text-embedding-3-small";

const { program } = caporal;
Expand Down Expand Up @@ -214,7 +214,7 @@ export async function updateEmbeddings(
const [{ total_tokens, embedding }, embedding_next] = await Promise.all(
[
createEmbedding(text, EMBEDDING_MODEL),
EMBEDDING_MODEL_NEXT
EMBEDDING_MODEL_NEXT && EMBEDDING_MODEL_NEXT !== EMBEDDING_MODEL
? createEmbedding(text, EMBEDDING_MODEL_NEXT).then(
({ embedding }) => embedding
)
Expand Down Expand Up @@ -257,7 +257,7 @@ export async function updateEmbeddings(
markdown_hash,
total_tokens,
pgvector.toSql(embedding),
embedding_next ? pgvector.toSql(embedding_next) : null,
pgvector.toSql(embedding_next ?? embedding),
text_hash,
],
rowMode: "array",
Expand Down

0 comments on commit 5144908

Please sign in to comment.