Download app.py from Beyou8778/deeplx: direct link, hf CLI and curl.
- Browser
- Download file 743 Bytes
-
https://huggingface.co/spaces/Beyou8778/deeplx/resolve/main/app.py
- Command line
-
hf download hf://spaces/Beyou8778/deeplx/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Beyou8778/deeplx/resolve/main/app.py
743 Bytes
| import gradio as gr | |
| def translate_demo(text, target_lang): | |
| if not text.strip(): | |
| return "Vui lòng nhập văn bản cần dịch." | |
| return f"[Demo Client-side] Văn bản '{text}' chuẩn bị gửi tới DeepLX API ({target_lang})." | |
| with gr.Blocks(title="DeepLX Lite Server") as demo: | |
| gr.Markdown("# 🚀 DeepLX Static Client / Proxy") | |
| with gr.Row(): | |
| inp_text = gr.Textbox(label="Văn bản", placeholder="Nhập văn bản...") | |
| lang_select = gr.Dropdown(["VI", "EN", "ZH", "JA"], value="VI", label="Ngôn ngữ đích") | |
| btn = gr.Button("Dịch thử") | |
| out_text = gr.Textbox(label="Kết quả") | |
| btn.click(fn=translate_demo, inputs=[inp_text, lang_select], outputs=out_text) | |
| demo.launch() |