Skip to content

Commit

Permalink
Fix key_values and a typo
Browse files Browse the repository at this point in the history
  • Loading branch information
elgeish committed Aug 1, 2020
1 parent 480591a commit 80ff765
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradio/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def postprocess(self, prediction):
if isinstance(prediction, str) or isinstance(prediction, int) or isinstance(prediction, float):
return str(prediction)
else:
raise ValueError("The `Textbox` output interface expects an output that is one of: a string, or"
raise ValueError("The `HighlightedText` output interface expects an output that is one of: a string, or"
"an int/float that can be converted to a string.")


Expand Down
6 changes: 3 additions & 3 deletions gradio/static/js/interfaces/output/key_values.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const key_values = {
init: function(opts) {},
output: function(data) {
let html = ""
for (let row of data) {
for (const [key, value] of Object.entries(data)) {
html += `<tr>
<td>${row[0]}</td>
<td>${row[1]}</td>
<td>${key}</td>
<td>${value}</td>
</tr>`;
}
this.target.find("tbody").html(html);
Expand Down

0 comments on commit 80ff765

Please sign in to comment.