fixes with HighlightedText, variables (#1563)

* changes

* removed comment things

* updated version

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
aliabid94 2022-06-16 17:32:14 -07:00 committed by GitHub
parent cb2aa4a625
commit 6413b65328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 12 deletions

View File

@ -199,6 +199,10 @@ def update(**kwargs) -> dict:
return kwargs
def is_update(val):
return type(val) is dict and "update" in val.get("__type__", "")
def skip() -> dict:
return update()
@ -488,13 +492,12 @@ class Blocks(BlockContext):
for i, output_id in enumerate(dependency["outputs"]):
block = self.blocks[output_id]
if getattr(block, "stateful", False):
state[output_id] = predictions[i]
if not is_update(predictions[i]):
state[output_id] = predictions[i]
output.append(None)
else:
prediction_value = predictions[i]
if type(
prediction_value
) is dict and "update" in prediction_value.get("__type__", ""):
if is_update(prediction_value):
if prediction_value["__type__"] == "generic_update":
del prediction_value["__type__"]
prediction_value = block.__class__.update(

View File

@ -1 +1 @@
3.0.16
3.0.18

View File

@ -26,11 +26,10 @@
let mode: "categories" | "scores";
if (color_map === null) {
color_map = {};
}
$: {
if (!color_map) {
color_map = {};
}
if (value.length > 0) {
for (let [_, label] of value) {
if (label !== null) {
@ -118,7 +117,7 @@
>
<span class="text ">{text}</span>
{#if !show_legend && category !== null}
<span
&nbsp;<span
class="label mr-[-4px] font-bold uppercase text-xs inline-category text-white rounded-sm px-[0.325rem] mt-[0.05rem] py-[0.05rem] transition-colors"
style:background-color={category === null ||
(active && active !== category)
@ -127,8 +126,8 @@
>
{category}
</span>
{/if}
</span>
{/if}</span
>
{/each}
</div>
{:else}