mintlee commited on
Commit
5a8be60
·
1 Parent(s): c4810eb

fix translate

Browse files
Files changed (1) hide show
  1. translate/translator.py +1 -1
translate/translator.py CHANGED
@@ -3,7 +3,7 @@ from typing import Dict, List
3
  import google.generativeai as genai
4
 
5
 
6
- def translate_text_dict(text_dict: Dict[str, List[str]], source_lang: str, target_lang: str = "vi", gemini_api: str = "") -> Dict[str, List[str]]:
7
  def translate_batch(batch_dict: Dict[str, List[str]]) -> Dict[str, List[str]]:
8
  """Translates a single batch of text."""
9
  prompt = f"""The following python dictionary contains pieces of text that form a whole document: {json.dumps(batch_dict)}.
 
3
  import google.generativeai as genai
4
 
5
 
6
+ def translate_text_dict(text_dict: Dict[str, List[str]], target_lang: str = "vi", gemini_api: str = "") -> Dict[str, List[str]]:
7
  def translate_batch(batch_dict: Dict[str, List[str]]) -> Dict[str, List[str]]:
8
  """Translates a single batch of text."""
9
  prompt = f"""The following python dictionary contains pieces of text that form a whole document: {json.dumps(batch_dict)}.