Update visualqa.html
Browse files- visualqa.html +2 -2
visualqa.html
CHANGED
@@ -139,10 +139,10 @@
|
|
139 |
const question = document.getElementById("question").value.trim();
|
140 |
document.getElementById("logs").textContent = "";
|
141 |
const method = model_type === "document" ? hf.documentQuestionAnswering : hf.visualQuestionAnswering;
|
142 |
-
const
|
143 |
image, question
|
144 |
}});
|
145 |
-
document.getElementById("logs").textContent = answer + ": " + score + start + end;
|
146 |
} catch (err) {
|
147 |
alert("Error: " + err.message);
|
148 |
} finally {
|
|
|
139 |
const question = document.getElementById("question").value.trim();
|
140 |
document.getElementById("logs").textContent = "";
|
141 |
const method = model_type === "document" ? hf.documentQuestionAnswering : hf.visualQuestionAnswering;
|
142 |
+
const result = await method({model, inputs: { //{answer, score, start, end}
|
143 |
image, question
|
144 |
}});
|
145 |
+
document.getElementById("logs").textContent = JSON.stringify(result, null, 2); //answer + ": " + score + start + end;
|
146 |
} catch (err) {
|
147 |
alert("Error: " + err.message);
|
148 |
} finally {
|