Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -25,8 +25,6 @@ target_languages = flores_codes # 简化列表
|
|
25 |
device = "cpu"
|
26 |
MODEL_NAME = "Qwen/Qwen3-0.6B"
|
27 |
|
28 |
-
code_mapping = dict(sorted(code_mapping.items(), key=lambda item: item[0]))
|
29 |
-
flores_codes = list(code_mapping.keys())
|
30 |
|
31 |
|
32 |
def load_model():
|
@@ -54,10 +52,6 @@ def translate(text: str, src_lang: str, tgt_lang: str):
|
|
54 |
# Only assign GPU if cache not used
|
55 |
@spaces.GPU
|
56 |
def _translate(text: str, src_lang: str, tgt_lang: str):
|
57 |
-
|
58 |
-
# normalizing the punctuation first
|
59 |
-
text = punct_normalizer.normalize(text)
|
60 |
-
|
61 |
paragraphs = text.split("\n")
|
62 |
translated_paragraphs = []
|
63 |
|
|
|
25 |
device = "cpu"
|
26 |
MODEL_NAME = "Qwen/Qwen3-0.6B"
|
27 |
|
|
|
|
|
28 |
|
29 |
|
30 |
def load_model():
|
|
|
52 |
# Only assign GPU if cache not used
|
53 |
@spaces.GPU
|
54 |
def _translate(text: str, src_lang: str, tgt_lang: str):
|
|
|
|
|
|
|
|
|
55 |
paragraphs = text.split("\n")
|
56 |
translated_paragraphs = []
|
57 |
|