goversetv commited on
Commit
2131c7f
โ€ข
1 Parent(s): 05d84c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -5,7 +5,7 @@ import pykakasi
5
  import os
6
 
7
  # ๋ฒ„์ „ ์ •๋ณด
8
- __version__ = "1.8.23"
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 id="result_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,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
- button#result_button {
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