radinhas commited on
Commit
5cf09a6
1 Parent(s): dfc1d78

Update apis/chat_api.py

Browse files
Files changed (1) hide show
  1. apis/chat_api.py +2 -1
apis/chat_api.py CHANGED
@@ -82,6 +82,7 @@ class ChatAPIApp:
82
 
83
  def translate_ai_completions(self, item: TranslateCompletionsPostItem):
84
  translator = Translator()
 
85
  f = open('apis/lang_name.json', "r")
86
  available_langs = json.loads(f.read())
87
  from_lang = 'en'
@@ -107,7 +108,7 @@ class ChatAPIApp:
107
  time_start = time.time()
108
  #TRANSFORMERS_CACHE
109
  pretrained_model = "facebook/m2m100_1.2B"
110
- cache_dir = "/home/models/"
111
  tokenizer = M2M100Tokenizer.from_pretrained(pretrained_model, cache_dir=cache_dir)
112
  model = M2M100ForConditionalGeneration.from_pretrained(
113
  pretrained_model, cache_dir=cache_dir
 
82
 
83
  def translate_ai_completions(self, item: TranslateCompletionsPostItem):
84
  translator = Translator()
85
+ print(os.getcwd())
86
  f = open('apis/lang_name.json', "r")
87
  available_langs = json.loads(f.read())
88
  from_lang = 'en'
 
108
  time_start = time.time()
109
  #TRANSFORMERS_CACHE
110
  pretrained_model = "facebook/m2m100_1.2B"
111
+ cache_dir = "home/models/"
112
  tokenizer = M2M100Tokenizer.from_pretrained(pretrained_model, cache_dir=cache_dir)
113
  model = M2M100ForConditionalGeneration.from_pretrained(
114
  pretrained_model, cache_dir=cache_dir