DreamerHC commited on
Commit
6b24c42
โ€ข
1 Parent(s): 304c8dc

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def calculate_fortune(date):
4
+ # ์—ฌ๊ธฐ์— ์‚ฌ์ฃผ ๊ณ„์‚ฐ ๋กœ์ง์„ ๊ตฌํ˜„ํ•ฉ๋‹ˆ๋‹ค.
5
+ # ์˜ˆ์ œ์—์„œ๋Š” ์ž…๋ ฅ๋ฐ›์€ ๋‚ ์งœ๋ฅผ ๊ทธ๋Œ€๋กœ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
6
+ return f"์ž…๋ ฅํ•˜์‹  ๋‚ ์งœ๋Š” {date}์ž…๋‹ˆ๋‹ค. ์‚ฌ์ฃผ ์ •๋ณด๋ฅผ ์—ฌ๊ธฐ์— ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค."
7
+
8
+ # Gradio ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌ์„ฑ
9
+ demo = gr.Interface(
10
+ fn=calculate_fortune,
11
+ inputs=gr.Date(label="์‚ฌ์ฃผ๋ฅผ ํ™•์ธํ•  ๋‚ ์งœ๋ฅผ ์„ ํƒํ•˜์„ธ์š”."),
12
+ outputs="text",
13
+ title="์‚ฌ์ฃผ ์ž…๋ ฅ ์บ˜๋ฆฐ๋”",
14
+ description="ํŠน์ • ๋‚ ์งœ์— ๋Œ€ํ•œ ์‚ฌ์ฃผ ์ •๋ณด๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค."
15
+ )
16
+
17
+ # ์ธํ„ฐํŽ˜์ด์Šค ์‹คํ–‰
18
+ if __name__ == "__main__":
19
+ demo.launch()