rivapereira123 commited on
Commit
d6b0e28
·
verified ·
1 Parent(s): 762233f

Update core/ai_engine.py

Browse files
Files changed (1) hide show
  1. 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=512)[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.en_to_ar(text, max_length=1024)[0]["translation_text"]
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":