Spaces:
Build error
Build error
Commit ·
cd4b2cd
1
Parent(s): a0d3937
feat: labels for textboxes
Browse files
app.py
CHANGED
|
@@ -11,9 +11,7 @@ WIDTH = 12
|
|
| 11 |
HEIGHT = 2
|
| 12 |
|
| 13 |
|
| 14 |
-
def generate_charts(
|
| 15 |
-
unique, counts, d, format="png", grayscale: bool = True
|
| 16 |
-
) -> dict:
|
| 17 |
plot = io.BytesIO()
|
| 18 |
hist = io.BytesIO()
|
| 19 |
pie = io.BytesIO()
|
|
@@ -170,13 +168,17 @@ def getints(numbers: str, grayscale: bool = True):
|
|
| 170 |
ls = list(map(int, numbers.split(" ")))
|
| 171 |
return make_all(ls, grayscale)
|
| 172 |
|
|
|
|
| 173 |
with open("examples.json") as jf:
|
| 174 |
examples = json.load(jf)
|
| 175 |
|
| 176 |
iface = gr.Interface(
|
| 177 |
fn=getints,
|
| 178 |
-
inputs=["
|
| 179 |
-
outputs=[
|
|
|
|
|
|
|
|
|
|
| 180 |
title="Tilted Calculator",
|
| 181 |
examples=examples,
|
| 182 |
)
|
|
|
|
| 11 |
HEIGHT = 2
|
| 12 |
|
| 13 |
|
| 14 |
+
def generate_charts(unique, counts, d, format="png", grayscale: bool = True) -> dict:
|
|
|
|
|
|
|
| 15 |
plot = io.BytesIO()
|
| 16 |
hist = io.BytesIO()
|
| 17 |
pie = io.BytesIO()
|
|
|
|
| 168 |
ls = list(map(int, numbers.split(" ")))
|
| 169 |
return make_all(ls, grayscale)
|
| 170 |
|
| 171 |
+
|
| 172 |
with open("examples.json") as jf:
|
| 173 |
examples = json.load(jf)
|
| 174 |
|
| 175 |
iface = gr.Interface(
|
| 176 |
fn=getints,
|
| 177 |
+
inputs=[gr.Textbox(show_copy_button=True, label="Numbers"), "checkbox"],
|
| 178 |
+
outputs=[
|
| 179 |
+
gr.Textbox(show_copy_button=True, label="Chart"),
|
| 180 |
+
gr.Textbox(show_copy_button=True, label="Variance"),
|
| 181 |
+
],
|
| 182 |
title="Tilted Calculator",
|
| 183 |
examples=examples,
|
| 184 |
)
|