Skip to content

Commit

Permalink
Fixes constant loading spinner in Embeddings Projector.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 551200920
  • Loading branch information
RyanMullins authored and LIT team committed Jul 26, 2023
1 parent 4db0dec commit 21d523d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lit_nlp/client/modules/embeddings_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,6 @@ export class EmbeddingsModule extends LitModule {
}

private async computeProjectedEmbeddings() {
this.isLoading = true;

// Clear projections if dataset is empty.
if (!this.appState.currentInputData.length) {
this.projectedPoints = [];
Expand All @@ -430,6 +428,8 @@ export class EmbeddingsModule extends LitModule {
if (!embeddingsInfo) {
return;
}

this.isLoading = true;
const {modelName, fieldName} = embeddingsInfo;

const datasetName = this.appState.currentDataset;
Expand All @@ -449,7 +449,10 @@ export class EmbeddingsModule extends LitModule {
const promise = embeddingRequestCache.call(this.appState.currentInputData);
const results =
await this.loadLatest(`proj-${JSON.stringify(projConfig)}`, promise);
if (results === null) return;
if (results === null) {
this.isLoading = false;
return;
}

// Compute sprite map if image data.
if (this.appState.datasetHasImages) {
Expand Down

0 comments on commit 21d523d

Please sign in to comment.