Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle failures of machine learning server #180

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

sarge1989
Copy link
Collaborator

Issues

#179

Summary

  • Basically implemented error handling to:
    • make sure embeddings are set to null if getEmbedding fails
    • make sure errors in getL1Category will handle gracefully and return error

@sarge1989 sarge1989 requested a review from stonefruit October 22, 2023 09:04
@sarge1989 sarge1989 mentioned this pull request Oct 22, 2023
@@ -25,8 +25,12 @@ async function calculateSimilarity(
score?: number
parent?: admin.firestore.DocumentReference<admin.firestore.DocumentData> | null
} = {}
const embedding = await getEmbedding(text)

let embedding = null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be cleaner to put the try catch in getEmbedding instead and let it return string | null

@sarge1989 sarge1989 merged commit 3a8673f into develop Oct 25, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors not handled when machine learning server dies for getL1Category / getEmbedding
3 participants