mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-30 11:00:11 +08:00
Fix key_values and a typo
This commit is contained in:
parent
c8bff4345b
commit
e55c956a94
@ -249,7 +249,7 @@ class HighlightedText(AbstractOutput):
|
||||
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.")
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user