Spaces:
Runtime error
Runtime error
File size: 498 Bytes
3161eae 87451e6 3161eae 7cd92f7 acd96dd 3161eae 87451e6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import gradio as gr
import time
ko2enDict = {
"μ¬κ³Ό":"apple",
"μ¬μ":"lion",
"μ¬λ":"love"
}
en2koDict = {
"apple":"μ¬κ³Ό",
"lion":"μ¬μ",
"love":"μ¬λ"
}
dict = {"ko2en":ko2enDict, "en2ko":en2koDict}
def trans(type, word):
return dict[type][word]
app = gr.Interface(
fn=trans,
inputs=[gr.Radio(["ko2en", "en2ko"]), gr.Textbox(placeholder="κ²μμ΄")],
outputs="text",
examples=[["ko2en", "μ¬μ"]],
allow_flagging="auto"
)
app.launch()
|