Spaces:
Runtime error
Runtime error
Switching text chunking and using 7b instead of 3b
Browse files- app.py +1 -0
- model_translation.py +1 -1
app.py
CHANGED
|
@@ -169,6 +169,7 @@ def translate_text(
|
|
| 169 |
tgt_lang = 'en' # Default "easy" language
|
| 170 |
|
| 171 |
chunks = build_text_chunks(text, src_lang, sents_per_chunk)
|
|
|
|
| 172 |
|
| 173 |
#translated_text_Helsinki = translate_with_Helsinki(
|
| 174 |
# chunks, src_lang, tgt_lang, input_max_length, output_max_length)
|
|
|
|
| 169 |
tgt_lang = 'en' # Default "easy" language
|
| 170 |
|
| 171 |
chunks = build_text_chunks(text, src_lang, sents_per_chunk)
|
| 172 |
+
chunks = [text, ]
|
| 173 |
|
| 174 |
#translated_text_Helsinki = translate_with_Helsinki(
|
| 175 |
# chunks, src_lang, tgt_lang, input_max_length, output_max_length)
|
model_translation.py
CHANGED
|
@@ -55,7 +55,7 @@ class ModelMADLAD(metaclass=Singleton):
|
|
| 55 |
"""Loads an instance of the Google MADLAD model (3B).
|
| 56 |
"""
|
| 57 |
def __init__(self):
|
| 58 |
-
self._model_name = "google/madlad400-
|
| 59 |
self._tokenizer = AutoTokenizer.from_pretrained(
|
| 60 |
self.model_name, use_fast=True
|
| 61 |
)
|
|
|
|
| 55 |
"""Loads an instance of the Google MADLAD model (3B).
|
| 56 |
"""
|
| 57 |
def __init__(self):
|
| 58 |
+
self._model_name = "google/madlad400-7b-mt"
|
| 59 |
self._tokenizer = AutoTokenizer.from_pretrained(
|
| 60 |
self.model_name, use_fast=True
|
| 61 |
)
|