Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import pykakasi
|
|
5 |
import os
|
6 |
|
7 |
# ๋ฒ์ ์ ๋ณด
|
8 |
-
__version__ = "1.8.
|
9 |
|
10 |
# Kakasi ์ธ์คํด์ค ์์ฑ ๋ฐ ์ค์
|
11 |
kakasi = pykakasi.kakasi()
|
@@ -34,12 +34,12 @@ def search_and_update_history(keyword, conversion_type):
|
|
34 |
url = f"https://www.irasutoya.com/search?q={converted_keyword}"
|
35 |
result_button_html = f'''
|
36 |
<a href="{url}" target="_blank">
|
37 |
-
<button
|
38 |
</a>
|
39 |
'''
|
40 |
return result, gr.update(value=audio_path, visible=True), gr.update(value=result_button_html, visible=True)
|
41 |
else:
|
42 |
-
return result, gr.update(visible=False), gr.update(visible
|
43 |
|
44 |
def search(keyword, conversion_type):
|
45 |
try:
|
@@ -82,6 +82,7 @@ with gr.Blocks(css="""
|
|
82 |
border: none;
|
83 |
border-radius: 5px;
|
84 |
cursor: pointer;
|
|
|
85 |
}
|
86 |
button#clear_button {
|
87 |
background-color: #A9A9A9;
|
@@ -91,8 +92,9 @@ with gr.Blocks(css="""
|
|
91 |
border: none;
|
92 |
border-radius: 5px;
|
93 |
cursor: pointer;
|
|
|
94 |
}
|
95 |
-
|
96 |
background-color: #28a745;
|
97 |
color: white;
|
98 |
font-size: 16px;
|
@@ -102,29 +104,27 @@ with gr.Blocks(css="""
|
|
102 |
cursor: pointer;
|
103 |
width: 100%;
|
104 |
}
|
105 |
-
button:hover {
|
106 |
-
background-color: inherit;
|
107 |
-
}
|
108 |
""") as demo:
|
109 |
with gr.Column(elem_id="container"):
|
110 |
gr.Markdown("<h2 style='text-align: center;'>์ด๋ผ์คํ ์ผ ์ผ๋ฌ์คํธ ๊ฒ์๊ธฐ</h2>")
|
111 |
|
112 |
keyword_input = gr.Textbox(
|
113 |
label="ํ๊ธ ๊ฒ์์ด ์
๋ ฅ",
|
114 |
-
placeholder="ํ๊ธ๋ก ๊ฒ์์ด๋ฅผ ์
๋ ฅํ์ธ์"
|
115 |
-
elem_id="keyword_input"
|
116 |
)
|
117 |
conversion_type = gr.Radio(
|
118 |
label="๋ณํ ์ ํ ์ ํ",
|
119 |
choices=["๊ธฐ๋ณธ", "ํ๋ผ๊ฐ๋", "๊ฐํ์นด๋", "ํ์"],
|
120 |
-
value="๊ธฐ๋ณธ"
|
121 |
-
elem_id="conversion_type"
|
122 |
)
|
123 |
-
|
|
|
124 |
search_button = gr.Button("๊ฒ์", elem_id="search_button")
|
|
|
|
|
125 |
clear_button = gr.Button("์ง์ฐ๊ธฐ", elem_id="clear_button")
|
126 |
|
127 |
-
result_button = gr.HTML(visible=False) # ๊ฒ์ ๊ฒฐ๊ณผ ๋ณด๊ธฐ
|
128 |
result_output = gr.Markdown()
|
129 |
play_audio = gr.Audio(visible=False, label="์ผ๋ณธ์ด ๋ฐ์ ๋ฃ๊ธฐ")
|
130 |
|
|
|
5 |
import os
|
6 |
|
7 |
# ๋ฒ์ ์ ๋ณด
|
8 |
+
__version__ = "1.8.29"
|
9 |
|
10 |
# Kakasi ์ธ์คํด์ค ์์ฑ ๋ฐ ์ค์
|
11 |
kakasi = pykakasi.kakasi()
|
|
|
34 |
url = f"https://www.irasutoya.com/search?q={converted_keyword}"
|
35 |
result_button_html = f'''
|
36 |
<a href="{url}" target="_blank">
|
37 |
+
<button style="background-color: #28a745; color: white; font-size: 16px; padding: 10px; border: none; border-radius: 5px; cursor: pointer; width: 100%;">๊ฒ์ ๊ฒฐ๊ณผ ๋ณด๊ธฐ</button>
|
38 |
</a>
|
39 |
'''
|
40 |
return result, gr.update(value=audio_path, visible=True), gr.update(value=result_button_html, visible=True)
|
41 |
else:
|
42 |
+
return result, gr.update(visible=False), gr.update(visible(False))
|
43 |
|
44 |
def search(keyword, conversion_type):
|
45 |
try:
|
|
|
82 |
border: none;
|
83 |
border-radius: 5px;
|
84 |
cursor: pointer;
|
85 |
+
width: 100%;
|
86 |
}
|
87 |
button#clear_button {
|
88 |
background-color: #A9A9A9;
|
|
|
92 |
border: none;
|
93 |
border-radius: 5px;
|
94 |
cursor: pointer;
|
95 |
+
width: 100%;
|
96 |
}
|
97 |
+
#result_button {
|
98 |
background-color: #28a745;
|
99 |
color: white;
|
100 |
font-size: 16px;
|
|
|
104 |
cursor: pointer;
|
105 |
width: 100%;
|
106 |
}
|
|
|
|
|
|
|
107 |
""") as demo:
|
108 |
with gr.Column(elem_id="container"):
|
109 |
gr.Markdown("<h2 style='text-align: center;'>์ด๋ผ์คํ ์ผ ์ผ๋ฌ์คํธ ๊ฒ์๊ธฐ</h2>")
|
110 |
|
111 |
keyword_input = gr.Textbox(
|
112 |
label="ํ๊ธ ๊ฒ์์ด ์
๋ ฅ",
|
113 |
+
placeholder="ํ๊ธ๋ก ๊ฒ์์ด๋ฅผ ์
๋ ฅํ์ธ์"
|
|
|
114 |
)
|
115 |
conversion_type = gr.Radio(
|
116 |
label="๋ณํ ์ ํ ์ ํ",
|
117 |
choices=["๊ธฐ๋ณธ", "ํ๋ผ๊ฐ๋", "๊ฐํ์นด๋", "ํ์"],
|
118 |
+
value="๊ธฐ๋ณธ"
|
|
|
119 |
)
|
120 |
+
|
121 |
+
# ๊ฒ์ ๋ฒํผ
|
122 |
search_button = gr.Button("๊ฒ์", elem_id="search_button")
|
123 |
+
|
124 |
+
# ์ง์ฐ๊ธฐ ๋ฒํผ
|
125 |
clear_button = gr.Button("์ง์ฐ๊ธฐ", elem_id="clear_button")
|
126 |
|
127 |
+
result_button = gr.HTML(visible=False) # ๊ฒ์ ๊ฒฐ๊ณผ ๋ณด๊ธฐ ๋ฒํผ
|
128 |
result_output = gr.Markdown()
|
129 |
play_audio = gr.Audio(visible=False, label="์ผ๋ณธ์ด ๋ฐ์ ๋ฃ๊ธฐ")
|
130 |
|