hwang1 commited on
Commit
0f4d40a
ยท
verified ยท
1 Parent(s): 9c46d87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -70,18 +70,22 @@ if __name__ == "__main__":
70
  # ์—ฌ๊ธฐ์„œ fig ๊ฐ์ฒด๋ฅผ ๋‹ค๋ฅธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์— ์ „๋‹ฌํ•˜๊ฑฐ๋‚˜, ๋‹ค๋ฅธ ๋ฐฉ์‹์œผ๋กœ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
71
 
72
 
73
- def my_function(input):
74
- return f"Processed: {input}"
 
 
 
 
75
 
76
- with open("style.css", "r") as f:
77
  css = f.read()
78
 
79
  iface = gr.Interface(
80
- fn=my_function,
81
- inputs=gr.Textbox(lines=2, placeholder="Type here..."),
82
- outputs="text",
83
  css=css,
84
- title="My Custom Styled App",
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()