Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,9 +48,10 @@ def main():
|
|
48 |
<span style="font-size: 22px;"><a href="https://huggingface.co/davidkim205/kgrammar-2-9b" target="_blank" style="text-decoration: none; color: #000080;">Kgrammar model link << Click here!</a></span> </br></br>
|
49 |
"""
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
54 |
|
55 |
with gr.Blocks() as app:
|
56 |
gr.Markdown("# Checking Korean Grammar Accuracy with KGrammar")
|
@@ -75,24 +76,20 @@ def main():
|
|
75 |
with gr.Row():
|
76 |
with gr.Column(scale=1):
|
77 |
text1 = gr.Textbox(label="User Message")
|
78 |
-
text2 = gr.Textbox(value="한국어 문맥상 부자연스러운 부분을 찾으시오. 오류 문장과 개수는 <incorrect grammar> </incorrect grammar> tag, 즉 <incorrect grammar> - 오류 문장과 설명 </incorrect grammar> 안에 담겨 있으며, <wrong count> </wrong count> tag, 즉 <wrong count> 오류 개수 </wrong count> 이다."
|
79 |
-
dropdown = gr.Dropdown(choices=["davidkim205/kgrammar-2-1b", "davidkim205/kgrammar-2-3b"], value="davidkim205/kgrammar-2-1b"
|
80 |
-
slider1 = gr.Slider(minimum=1, maximum=2048, value=1024, step=1
|
81 |
-
slider2 = gr.Slider(minimum=0.1, maximum=4.0, value=1.0, step=0.1
|
82 |
-
slider3 = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05
|
83 |
submit = gr.Button("Submit", elem_id="submit-btn")
|
84 |
with gr.Column(scale=1):
|
85 |
output = gr.Textbox(label="Output")
|
86 |
|
87 |
gr.Markdown("")
|
88 |
gr.Markdown("## Examples")
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
with gr.Column():
|
93 |
-
gr.Examples(label="Example2", examples=example2, inputs=[text1, text2, dropdown, slider1, slider2, slider3])
|
94 |
-
with gr.Column():
|
95 |
-
gr.Examples(label="Example3", examples=example3, inputs=[text1, text2, dropdown, slider1, slider2, slider3])
|
96 |
|
97 |
submit.click(
|
98 |
fn=respond,
|
|
|
48 |
<span style="font-size: 22px;"><a href="https://huggingface.co/davidkim205/kgrammar-2-9b" target="_blank" style="text-decoration: none; color: #000080;">Kgrammar model link << Click here!</a></span> </br></br>
|
49 |
"""
|
50 |
|
51 |
+
examples_list = [["우선, 성인 티켓의 가격은 $4입니다. 총 판매된 티켓 수는 59장이며, 학생 티켓은 9장입니다. 我们需要计算学生票价。성인 티켓은 50장이 판매되었으므로, 성인 티켓으로 얻은 수익은 50 * 4 = $200입니다. Total revenue是 $222.50, 所以学生票的收入为 $222.50 - $200 = $22.50。俄语로 说, 每张学生票的价格 = $22.50 ÷ 9 = $2.50。학생 티켓의 가격은 2.5ดอลล่าครับ.", "한국어 문맥상 부자연스러운 부분을 찾으시오. 오류 문장과 개수는 <incorrect grammar> </incorrect grammar> tag, 즉 <incorrect grammar> - 오류 문장과 설명 </incorrect grammar> 안에 담겨 있으며, <wrong count> </wrong count> tag, 즉 <wrong count> 오류 개수 </wrong count> 이다.", None, None, None, None],
|
52 |
+
["슈트라우스의 음악에서 모차르트의 음악 형태를 띈 악장의 끝에는 호른이 중심적으로 연주됩니다. Это инструмент, который связывает эпохи и стили, создавая неповторимую атмосферу и оставляя слушателей в восхищении.", "한국어 문맥상 부자연스러운 부분을 찾으시오. 오류 문장과 개수는 <incorrect grammar> </incorrect grammar> tag, 즉 <incorrect grammar> - 오류 문장과 설명 </incorrect grammar> 안에 담겨 있으며, <wrong count> </wrong count> tag, 즉 <wrong count> 오류 개수 </wrong count> 이다.", None, None, None, None],
|
53 |
+
["충남도가 백신 접종 안내 및 이상반응 모니터링을 위해 협정을 맺은 곳은 SK텔레콤(SKT)입니다. SKT의 AI 기술인 '누구(NUGU)'를 활용한 '누구 백신 케어콜' 서비스를 통해 이 업무를 수행할 계획입니다.", "한국어 문맥상 부자연스러운 부분을 찾으시오. 오류 문장과 개수는 <incorrect grammar> </incorrect grammar> tag, 즉 <incorrect grammar> - 오류 문장과 설명 </incorrect grammar> 안에 담겨 있으며, <wrong count> </wrong count> tag, 즉 <wrong count> 오류 개수 </wrong count> 이다.", None, None, None, None]
|
54 |
+
]
|
55 |
|
56 |
with gr.Blocks() as app:
|
57 |
gr.Markdown("# Checking Korean Grammar Accuracy with KGrammar")
|
|
|
76 |
with gr.Row():
|
77 |
with gr.Column(scale=1):
|
78 |
text1 = gr.Textbox(label="User Message")
|
79 |
+
text2 = gr.Textbox(label="System message", value="한국어 문맥상 부자연스러운 부분을 찾으시오. 오류 문장과 개수는 <incorrect grammar> </incorrect grammar> tag, 즉 <incorrect grammar> - 오류 문장과 설명 </incorrect grammar> 안에 담겨 있으며, <wrong count> </wrong count> tag, 즉 <wrong count> 오류 개수 </wrong count> 이다.")
|
80 |
+
dropdown = gr.Dropdown(label="Model Selection", choices=["davidkim205/kgrammar-2-1b", "davidkim205/kgrammar-2-3b"], value="davidkim205/kgrammar-2-1b")
|
81 |
+
slider1 = gr.Slider(label="Max new tokens", minimum=1, maximum=2048, value=1024, step=1)
|
82 |
+
slider2 = gr.Slider(label="Temperature", minimum=0.1, maximum=4.0, value=1.0, step=0.1)
|
83 |
+
slider3 = gr.Slider(label="Top-p (nucleus sampling)", minimum=0.1, maximum=1.0, value=0.95, step=0.05)
|
84 |
submit = gr.Button("Submit", elem_id="submit-btn")
|
85 |
with gr.Column(scale=1):
|
86 |
output = gr.Textbox(label="Output")
|
87 |
|
88 |
gr.Markdown("")
|
89 |
gr.Markdown("## Examples")
|
90 |
+
gr.Examples(label="Input Example",
|
91 |
+
examples=examples_list,
|
92 |
+
inputs=[text1, text2, dropdown, slider1, slider2, slider3])
|
|
|
|
|
|
|
|
|
93 |
|
94 |
submit.click(
|
95 |
fn=respond,
|