Spaces:
Running
Running
Update image-classification.html
Browse files
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 (
|
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 (
|
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");
|