Spaces:
Running
on
Zero
Running
on
Zero
Init gradio and gradio_rerun dependencies
Browse files- app.py +27 -0
- requirements.txt +1 -0
app.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from gradio_rerun import Rerun
|
3 |
+
|
4 |
+
|
5 |
+
def display_rrd(file):
|
6 |
+
if file is None:
|
7 |
+
return None
|
8 |
+
return file.name
|
9 |
+
|
10 |
+
|
11 |
+
with gr.Blocks() as demo:
|
12 |
+
with gr.Row():
|
13 |
+
file_input = gr.File(label="Upload RRD File")
|
14 |
+
with gr.Row():
|
15 |
+
viewer = Rerun(
|
16 |
+
streaming=True,
|
17 |
+
panel_states={
|
18 |
+
"time": "collapsed",
|
19 |
+
"blueprint": "hidden",
|
20 |
+
"selection": "hidden",
|
21 |
+
}
|
22 |
+
)
|
23 |
+
|
24 |
+
file_input.change(display_rrd, inputs=[file_input], outputs=[viewer])
|
25 |
+
|
26 |
+
if __name__ == "__main__":
|
27 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
gradio_rerun
|