boazchung commited on
Commit
1c774f4
1 Parent(s): a0e6dc6

Update image-classification.html

Browse files
Files changed (1) hide show
  1. image-classification.html +2 -2
image-classification.html CHANGED
@@ -106,7 +106,7 @@
106
  // Initialize the sentiment analysis model
107
  async function initializeModel() {
108
  classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');
109
- if (Promise.resolve(classifier) === classifier) {
110
  console.log("classifier is a Promise object");
111
  } else {
112
  console.log("classifier is not a Promise object");
@@ -134,7 +134,7 @@
134
  const url = URL.createObjectURL(file);
135
 
136
  const result = await classifier(url);
137
- if (Promise.resolve(result) === result) {
138
  console.log("result is a Promise object");
139
  } else {
140
  console.log("result is not a Promise object");
 
106
  // Initialize the sentiment analysis model
107
  async function initializeModel() {
108
  classifier = await pipeline('image-classification', 'Xenova/vit-base-patch16-224');
109
+ if (classifier instanceof Promise) {
110
  console.log("classifier is a Promise object");
111
  } else {
112
  console.log("classifier is not a Promise object");
 
134
  const url = URL.createObjectURL(file);
135
 
136
  const result = await classifier(url);
137
+ if (classifier instanceof Promise) {
138
  console.log("result is a Promise object");
139
  } else {
140
  console.log("result is not a Promise object");