Fix return value for custom embedding URL in HypaProcesser
This commit is contained in:
@@ -38,7 +38,7 @@ export class HypaProcesser{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async getEmbeds(input:string[]|string) {
|
async getEmbeds(input:string[]|string):Promise<VectorArray[]> {
|
||||||
if(this.model === 'MiniLM' || this.model === 'nomic'){
|
if(this.model === 'MiniLM' || this.model === 'nomic'){
|
||||||
const inputs:string[] = Array.isArray(input) ? input : [input]
|
const inputs:string[] = Array.isArray(input) ? input : [input]
|
||||||
let results:Float32Array[] = await runEmbedding(inputs, this.model === 'nomic' ? 'nomic-ai/nomic-embed-text-v1.5' : 'Xenova/all-MiniLM-L6-v2')
|
let results:Float32Array[] = await runEmbedding(inputs, this.model === 'nomic' ? 'nomic-ai/nomic-embed-text-v1.5' : 'Xenova/all-MiniLM-L6-v2')
|
||||||
@@ -47,8 +47,7 @@ export class HypaProcesser{
|
|||||||
let gf = null;
|
let gf = null;
|
||||||
if(this.model === 'custom'){
|
if(this.model === 'custom'){
|
||||||
if(!this.customEmbeddingUrl){
|
if(!this.customEmbeddingUrl){
|
||||||
alertError('Custom model requires a Custom Server URL')
|
throw new Error('Custom model requires a Custom Server URL')
|
||||||
return [0]
|
|
||||||
}
|
}
|
||||||
const {customEmbeddingUrl} = this
|
const {customEmbeddingUrl} = this
|
||||||
const replaceUrl = customEmbeddingUrl.endsWith('/embeddings')?customEmbeddingUrl:appendLastPath(customEmbeddingUrl,'embeddings')
|
const replaceUrl = customEmbeddingUrl.endsWith('/embeddings')?customEmbeddingUrl:appendLastPath(customEmbeddingUrl,'embeddings')
|
||||||
|
|||||||
Reference in New Issue
Block a user