We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9d784d commit cb39398Copy full SHA for cb39398
extensions/firestore-huggingface-inference-api/functions/src/index.ts
@@ -3,9 +3,9 @@ import * as functions from 'firebase-functions';
3
import config from './config';
4
5
import {
6
- InferenceOutputError,
7
- HfInferenceEndpoint,
8
HfInference,
+ HfInferenceEndpoint,
+ InferenceOutputError,
9
} from '@huggingface/inference';
10
import { runInference } from './inference';
11
@@ -21,6 +21,11 @@ export const triggerInference = functions.firestore
21
return;
22
}
23
24
+ if (snapshot.after.isEqual(snapshot.before)) {
25
+ functions.logger.info('Document have not changed, skipping inference');
26
+ return;
27
+ }
28
+
29
let inference: HfInference | HfInferenceEndpoint;
30
31
if (config.inferenceEndpoint) {
0 commit comments