Update app.py
Browse files
app.py
CHANGED
@@ -84,29 +84,46 @@ def translate_text(text, source_lang, target_lang):
|
|
84 |
|
85 |
|
86 |
description = """
|
87 |
-
<div
|
88 |
-
|
89 |
-
<
|
|
|
90 |
</div>
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
"""
|
93 |
|
94 |
# 创建 Gradio 界面
|
95 |
with gr.Blocks(title="Qwen3-MT Translator") as demo:
|
96 |
-
# gr.Markdown("# 🌍 Seed-X")
|
97 |
-
# gr.Markdown(
|
98 |
-
# 'A real-time translation tool based on the Qwen3-MT model<br><a href="https://www.alibabacloud.com/help/en/model-studio/translation-abilities" target="_blank">Learn more about Qwen3-MT and API documentation</a>',
|
99 |
-
# elem_id="desc"
|
100 |
-
# )
|
101 |
gr.Markdown(description)
|
102 |
-
# gr.Image(
|
103 |
-
# value="LOGO.jpg",
|
104 |
-
# label="Seed-X",
|
105 |
-
# show_label=False,
|
106 |
-
# show_download_button=False,
|
107 |
-
# interactive=False,
|
108 |
-
# height=60
|
109 |
-
# )
|
110 |
|
111 |
with gr.Row():
|
112 |
with gr.Column():
|
@@ -126,6 +143,7 @@ with gr.Blocks(title="Qwen3-MT Translator") as demo:
|
|
126 |
value="English",
|
127 |
label="Target Language"
|
128 |
)
|
|
|
129 |
|
130 |
with gr.Column():
|
131 |
target_text = gr.Textbox(
|
@@ -133,22 +151,21 @@ with gr.Blocks(title="Qwen3-MT Translator") as demo:
|
|
133 |
interactive=False,
|
134 |
lines=5
|
135 |
)
|
136 |
-
|
137 |
-
translate_btn = gr.Button("Translate", variant="primary")
|
138 |
|
139 |
# # 示例
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
|
153 |
# 按钮点击事件
|
154 |
translate_btn.click(
|
|
|
84 |
|
85 |
|
86 |
description = """
|
87 |
+
<div align="center">
|
88 |
+
👋 Hi, everyone!
|
89 |
+
<br>
|
90 |
+
We are <b>ByteDance Seed team.</b>
|
91 |
</div>
|
92 |
+
|
93 |
+
<p align="center">
|
94 |
+
You can get to know us better through the following channels👇
|
95 |
+
<br>
|
96 |
+
<a href="https://seed.bytedance.com/">
|
97 |
+
<img src="https://img.shields.io/badge/Website-%231e37ff?style=for-the-badge&logo=bytedance&logoColor=white"></a>
|
98 |
+
<a href="https://github.com/user-attachments/assets/5793e67c-79bb-4a59-811a-fcc7ed510bd4">
|
99 |
+
<img src="https://img.shields.io/badge/WeChat-07C160?style=for-the-badge&logo=wechat&logoColor=white"></a>
|
100 |
+
<a href="https://www.xiaohongshu.com/user/profile/668e7e15000000000303157d?xsec_token=ABl2-aqekpytY6A8TuxjrwnZskU-6BsMRE_ufQQaSAvjc%3D&xsec_source=pc_search">
|
101 |
+
<img src="https://img.shields.io/badge/Xiaohongshu-%23FF2442?style=for-the-badge&logo=xiaohongshu&logoColor=white"></a>
|
102 |
+
<a href="https://www.zhihu.com/org/dou-bao-da-mo-xing-tuan-dui/">
|
103 |
+
<img src="https://img.shields.io/badge/zhihu-%230084FF?style=for-the-badge&logo=zhihu&logoColor=white"></a>
|
104 |
+
</p>
|
105 |
+
|
106 |
+
<div align=center>
|
107 |
+
<img src="https://github.com/user-attachments/assets/c42e675e-497c-4508-8bb9-093ad4d1f216"/></div>
|
108 |
+
</div>
|
109 |
+
|
110 |
+
<!-- 注释:以上为Seed官方信息,可直接复制使用,请注意导入“Seed WeChat”(第12行)、“Seed logo”(第20行)图片替换 -->
|
111 |
+
|
112 |
+
|
113 |
+
# Seed-X: Building Strong Multilingual Translation LLM with 7B Parameters
|
114 |
+
<p align="center">
|
115 |
+
<a href="https://arxiv.org/pdf/2507.13618">
|
116 |
+
<img src="https://img.shields.io/badge/Seed--X-Report-blue"></a>
|
117 |
+
<a href="https://huggingface.co/collections/ByteDance-Seed/seed-x-6878753f2858bc17afa78543">
|
118 |
+
<img src="https://img.shields.io/badge/Seed--X-Hugging Face-brightgreen"></a>
|
119 |
+
<a href="https://github.com/ByteDance-Seed/Seed-X-7B/blob/main/LICENSE.openmdw">
|
120 |
+
<img src="https://img.shields.io/badge/License-OpenMDW-yellow"></a>
|
121 |
+
</p>
|
122 |
"""
|
123 |
|
124 |
# 创建 Gradio 界面
|
125 |
with gr.Blocks(title="Qwen3-MT Translator") as demo:
|
|
|
|
|
|
|
|
|
|
|
126 |
gr.Markdown(description)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
with gr.Row():
|
129 |
with gr.Column():
|
|
|
143 |
value="English",
|
144 |
label="Target Language"
|
145 |
)
|
146 |
+
translate_btn = gr.Button("Translate", variant="primary")
|
147 |
|
148 |
with gr.Column():
|
149 |
target_text = gr.Textbox(
|
|
|
151 |
interactive=False,
|
152 |
lines=5
|
153 |
)
|
154 |
+
|
|
|
155 |
|
156 |
# # 示例
|
157 |
+
gr.Examples(
|
158 |
+
examples=[
|
159 |
+
["你好,世界!", "Chinese", "English"],
|
160 |
+
["Hello, how are you today?", "English", "Chinese"],
|
161 |
+
["私は学生です。", "Japanese", "Chinese"],
|
162 |
+
["Bonjour, comment allez-vous?", "French", "English"]
|
163 |
+
],
|
164 |
+
inputs=[source_text, source_lang, target_lang],
|
165 |
+
outputs=target_text,
|
166 |
+
fn=translate_text,
|
167 |
+
cache_examples=True
|
168 |
+
)
|
169 |
|
170 |
# 按钮点击事件
|
171 |
translate_btn.click(
|