Spaces:
Sleeping
Sleeping
Update core/ai_engine.py
Browse files- core/ai_engine.py +2 -2
core/ai_engine.py
CHANGED
@@ -48,13 +48,13 @@ class ArabicTranslator:
|
|
48 |
if not self.ar_to_en:
|
49 |
print("⚠️ Arabic-to-English translation model not available.")
|
50 |
return text
|
51 |
-
return self.ar_to_en(text, max_length=
|
52 |
|
53 |
def translate_to_arabic(self, text):
|
54 |
if not self.en_to_ar:
|
55 |
print("⚠️ English-to-Arabic translation model not available.")
|
56 |
return text
|
57 |
-
return self.
|
58 |
|
59 |
def translate(self, text: str, direction: str = "to_en") -> str:
|
60 |
if direction == "to_en":
|
|
|
48 |
if not self.ar_to_en:
|
49 |
print("⚠️ Arabic-to-English translation model not available.")
|
50 |
return text
|
51 |
+
return self.ar_to_en(text[:1000], max_length=1024)[0]["translation_text"]
|
52 |
|
53 |
def translate_to_arabic(self, text):
|
54 |
if not self.en_to_ar:
|
55 |
print("⚠️ English-to-Arabic translation model not available.")
|
56 |
return text
|
57 |
+
return self.ar_to_en(text[:1000], max_length=1024)[0]["translation_text"]
|
58 |
|
59 |
def translate(self, text: str, direction: str = "to_en") -> str:
|
60 |
if direction == "to_en":
|