Fix purge extras and mistral vectors

This commit is contained in:
Cohee
2024-02-23 22:37:00 +02:00
parent 9b34ac1bde
commit 737a0bd3ae
2 changed files with 17 additions and 6 deletions

View File

@@ -4,6 +4,9 @@ const express = require('express');
const sanitize = require('sanitize-filename');
const { jsonParser } = require('../express-common');
// Don't forget to add new sources to the SOURCES array
const SOURCES = ['transformers', 'mistral', 'openai', 'extras', 'palm'];
/**
* Gets the vector for the given text from the given source.
* @param {string} source - The source of the vector
@@ -261,8 +264,7 @@ router.post('/purge', jsonParser, async (req, res) => {
const collectionId = String(req.body.collectionId);
const sources = ['transformers', 'openai', 'palm'];
for (const source of sources) {
for (const source of SOURCES) {
const index = await getIndex(collectionId, source, false);
const exists = await index.isIndexCreated();