File size: 649 Bytes
6b24c42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr

def calculate_fortune(date):
    # ์—ฌ๊ธฐ์— ์‚ฌ์ฃผ ๊ณ„์‚ฐ ๋กœ์ง์„ ๊ตฌํ˜„ํ•ฉ๋‹ˆ๋‹ค.
    # ์˜ˆ์ œ์—์„œ๋Š” ์ž…๋ ฅ๋ฐ›์€ ๋‚ ์งœ๋ฅผ ๊ทธ๋Œ€๋กœ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
    return f"์ž…๋ ฅํ•˜์‹  ๋‚ ์งœ๋Š” {date}์ž…๋‹ˆ๋‹ค. ์‚ฌ์ฃผ ์ •๋ณด๋ฅผ ์—ฌ๊ธฐ์— ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค."

# Gradio ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌ์„ฑ
demo = gr.Interface(
    fn=calculate_fortune,
    inputs=gr.Date(label="์‚ฌ์ฃผ๋ฅผ ํ™•์ธํ•  ๋‚ ์งœ๋ฅผ ์„ ํƒํ•˜์„ธ์š”."),
    outputs="text",
    title="์‚ฌ์ฃผ ์ž…๋ ฅ ์บ˜๋ฆฐ๋”",
    description="ํŠน์ • ๋‚ ์งœ์— ๋Œ€ํ•œ ์‚ฌ์ฃผ ์ •๋ณด๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค."
)

# ์ธํ„ฐํŽ˜์ด์Šค ์‹คํ–‰
if __name__ == "__main__":
    demo.launch()