Hugging Face
Models
Datasets
Spaces
Community
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
abidlabs
/
global-state-test
like
0
Sleeping
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
abidlabs
HF Staff
commited on
Feb 13, 2023
Commit
3828970
·
1 Parent(s):
93bba76
Create app.py
Browse files
Files changed (1)
hide
show
app.py
+11
-0
app.py
ADDED
Viewed
@@ -0,0 +1,11 @@
1
+
state = 0
2
+
3
+
def update_state(num):
4
+
state = num
5
+
6
+
7
+
with gr.Blocks() as demo:
8
+
number = gr.Number(value=state)
9
+
number.change(update_state, number, None)
10
+
11
+
demo.launch()