boazchung commited on
Commit
9a0f06e
1 Parent(s): c9e913f

Update visualqa.html

Browse files
Files changed (1) hide show
  1. 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 {answer, score, start, end} = await method({model, inputs: {
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 {