Spaces:
Running
Running
Commit
·
c684a3f
1
Parent(s):
16b92ef
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,23 @@
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import time
|
3 |
|
4 |
-
print(gr.__version__)
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
gr.Interface(
|
11 |
-
|
|
|
1 |
+
""" App
|
2 |
+
"""
|
3 |
+
|
4 |
import gradio as gr
|
5 |
import time
|
6 |
|
|
|
7 |
|
8 |
+
MB = 1024*1024
|
9 |
+
|
10 |
+
|
11 |
+
def eat_memory():
|
12 |
+
mem = []
|
13 |
+
while True:
|
14 |
+
mem += ['c' * (100 * MB)]
|
15 |
+
time.sleep(0.1)
|
16 |
+
|
17 |
+
|
18 |
+
def greet(name):
|
19 |
+
eat_memory()
|
20 |
+
return "Hello " + name + "!!"
|
21 |
|
22 |
+
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
23 |
+
iface.launch()
|