Update
Browse files- app.py +13 -1
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -1,9 +1,21 @@
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
|
| 3 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
with gr.Blocks() as demo:
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
if __name__ == "__main__":
|
| 9 |
demo.queue().launch()
|
|
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
+
import numpy as np
|
| 5 |
+
import pandas as pd
|
| 6 |
+
import plotly.express as px
|
| 7 |
+
|
| 8 |
+
np.random.seed(0)
|
| 9 |
+
|
| 10 |
+
df = pd.DataFrame({"x": np.arange(100), "y": np.random.normal(size=100).cumsum()})
|
| 11 |
+
fig = px.line(df, x="x", y="y")
|
| 12 |
|
| 13 |
with gr.Blocks() as demo:
|
| 14 |
+
with gr.Tabs():
|
| 15 |
+
with gr.Tab(label="a"):
|
| 16 |
+
gr.Plot(value=fig)
|
| 17 |
+
with gr.Tab(label="b"):
|
| 18 |
+
gr.Plot(value=fig)
|
| 19 |
|
| 20 |
if __name__ == "__main__":
|
| 21 |
demo.queue().launch()
|
requirements.txt
CHANGED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
plotly==5.18.0
|