Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -70,18 +70,22 @@ if __name__ == "__main__":
|
|
| 70 |
# ์ฌ๊ธฐ์ fig ๊ฐ์ฒด๋ฅผ ๋ค๋ฅธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ ๋ฌํ๊ฑฐ๋, ๋ค๋ฅธ ๋ฐฉ์์ผ๋ก ํ์ฉํ ์ ์์ต๋๋ค.
|
| 71 |
|
| 72 |
|
| 73 |
-
def
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
-
with open(
|
| 77 |
css = f.read()
|
| 78 |
|
| 79 |
iface = gr.Interface(
|
| 80 |
-
fn=
|
| 81 |
-
inputs=
|
| 82 |
-
outputs="
|
| 83 |
css=css,
|
| 84 |
-
title="
|
| 85 |
-
description="This is a simple Gradio app with custom CSS."
|
| 86 |
)
|
|
|
|
| 87 |
iface.launch()
|
|
|
|
| 70 |
# ์ฌ๊ธฐ์ fig ๊ฐ์ฒด๋ฅผ ๋ค๋ฅธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ ๋ฌํ๊ฑฐ๋, ๋ค๋ฅธ ๋ฐฉ์์ผ๋ก ํ์ฉํ ์ ์์ต๋๋ค.
|
| 71 |
|
| 72 |
|
| 73 |
+
def plot_data():
|
| 74 |
+
# ์์ ๊ทธ๋ํ ์์ฑ ์ฝ๋
|
| 75 |
+
fig = plt.figure()
|
| 76 |
+
ax = fig.add_subplot(111)
|
| 77 |
+
ax.plot([1, 2, 3, 4, 5], [2, 3, 2, 3, 4])
|
| 78 |
+
return fig
|
| 79 |
|
| 80 |
+
with open('style.css', 'r') as f:
|
| 81 |
css = f.read()
|
| 82 |
|
| 83 |
iface = gr.Interface(
|
| 84 |
+
fn=plot_data,
|
| 85 |
+
inputs=[], # ์
๋ ฅ ํ๋ผ๋ฏธํฐ ์กฐ์
|
| 86 |
+
outputs="plot", # ๊ทธ๋ํ ์ถ๋ ฅ ์ค์
|
| 87 |
css=css,
|
| 88 |
+
title="Plot Example"
|
|
|
|
| 89 |
)
|
| 90 |
+
|
| 91 |
iface.launch()
|