ABAO77 commited on
Commit
8bab22d
·
verified ·
1 Parent(s): a137fb0

Update apis/V1/prompts/translate_detail.py

Browse files
apis/V1/prompts/translate_detail.py CHANGED
@@ -29,7 +29,9 @@ class AskImage:
29
  self.context = []
30
 
31
  def explain_word(self, word: str, path_context: str):
32
- self.context = convert_from_path(path_context)
 
 
33
  prompt = self.prompt.format(word=word)
34
  print("contextpage",len(self.context))
35
  invoke = [prompt] + self.context[0:10]
 
29
  self.context = []
30
 
31
  def explain_word(self, word: str, path_context: str):
32
+ if self.context == []:
33
+ print("convert")
34
+ self.context = convert_from_path(path_context)
35
  prompt = self.prompt.format(word=word)
36
  print("contextpage",len(self.context))
37
  invoke = [prompt] + self.context[0:10]