From 9ece050a702618d3260f80506f3405a4a6dabbb9 Mon Sep 17 00:00:00 2001 From: Freddy Boulton Date: Thu, 9 May 2024 10:05:27 -0400 Subject: [PATCH] Fix bug where updating a component's value in reload mode would not be shown in UI (#8227) * Update code * add changeset * lint * Add code * add changeset --------- Co-authored-by: gradio-pr-bot --- .changeset/wicked-chairs-wait.md | 5 +++++ gradio/utils.py | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/wicked-chairs-wait.md diff --git a/.changeset/wicked-chairs-wait.md b/.changeset/wicked-chairs-wait.md new file mode 100644 index 0000000000..2eb4f449d9 --- /dev/null +++ b/.changeset/wicked-chairs-wait.md @@ -0,0 +1,5 @@ +--- +"gradio": patch +--- + +fix:Fix bug where updating a component's value in reload mode would not be shown in UI diff --git a/gradio/utils.py b/gradio/utils.py index c561586f8f..0eefcef762 100644 --- a/gradio/utils.py +++ b/gradio/utils.py @@ -312,6 +312,8 @@ def reassign_keys(old_blocks: Blocks, new_blocks: Blocks): old_block.__class__ == new_block.__class__ and old_block is not None and old_block.key not in assigned_keys + and json.dumps(getattr(old_block, "value", None)) + == json.dumps(getattr(new_block, "value", None)) ): new_block.key = old_block.key else: