egoing's picture
Update app.py
acd96dd
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()