Spaces:
Running
Running
return empty if error on hfapi endpoint (#1038)
Browse files
src/lib/server/embeddingEndpoints/hfApi/embeddingHfApi.ts
CHANGED
@@ -37,6 +37,7 @@ export async function embeddingEndpointHfApi(
|
|
37 |
if (!response.ok) {
|
38 |
console.log(await response.text());
|
39 |
console.error("Failed to get embeddings from Hugging Face API", response);
|
|
|
40 |
}
|
41 |
|
42 |
const embeddings: Embedding[] = await response.json();
|
|
|
37 |
if (!response.ok) {
|
38 |
console.log(await response.text());
|
39 |
console.error("Failed to get embeddings from Hugging Face API", response);
|
40 |
+
return [];
|
41 |
}
|
42 |
|
43 |
const embeddings: Embedding[] = await response.json();
|