Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import matplotlib.pyplot as plt
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
def plot_graph(x_values, y_values, optional1='', optional2='', optional3='', optional4='', optional5='', optional6='', optional7='', optional8='', optional9='', optional10=''):
|
| 6 |
+
plt.plot(x_values, y_values)
|
| 7 |
+
plt.title('Graph')
|
| 8 |
+
plt.xlabel('X-axis')
|
| 9 |
+
plt.ylabel('Y-axis')
|
| 10 |
+
plt.show()
|
| 11 |
+
|
| 12 |
+
inputs = [
|
| 13 |
+
gr.Textbox(label="X Values"),
|
| 14 |
+
gr.Textbox(label="Y Values"),
|
| 15 |
+
gr.Group([
|
| 16 |
+
gr.Textbox(label="Optional 1"),
|
| 17 |
+
gr.Textbox(label="Optional 2"),
|
| 18 |
+
gr.Textbox(label="Optional 3"),
|
| 19 |
+
gr.Textbox(label="Optional 4"),
|
| 20 |
+
gr.Textbox(label="Optional 5"),
|
| 21 |
+
gr.Textbox(label="Optional 6"),
|
| 22 |
+
gr.Textbox(label="Optional 7"),
|
| 23 |
+
gr.Textbox(label="Optional 8"),
|
| 24 |
+
gr.Textbox(label="Optional 9"),
|
| 25 |
+
gr.Textbox(label="Optional 10")
|
| 26 |
+
], label="Optional Fields", type="group", optional=True)
|
| 27 |
+
]
|
| 28 |
+
|
| 29 |
+
gr.Interface(plot_graph, inputs, "image").launch()
|