AndriiPets commited on
Commit
9c2c875
1 Parent(s): 03a8026
generator.py CHANGED
@@ -15,7 +15,8 @@ from utils.translators.translate_input import translate_input
15
  model_name_or_path = "flax-community/t5-recipe-generation"
16
  task = "text2text-generation"
17
 
18
- tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
 
19
  generator = pipeline(task, model=model_name_or_path,
20
  tokenizer=model_name_or_path)
21
 
 
15
  model_name_or_path = "flax-community/t5-recipe-generation"
16
  task = "text2text-generation"
17
 
18
+ tokenizer = AutoTokenizer.from_pretrained(
19
+ model_name_or_path, cache_dir='./cache')
20
  generator = pipeline(task, model=model_name_or_path,
21
  tokenizer=model_name_or_path)
22
 
utils/translators/en_ru/en_ru.py CHANGED
@@ -1,8 +1,9 @@
1
 
2
  from transformers import FSMTForConditionalGeneration, FSMTTokenizer
3
  mname = "facebook/wmt19-en-ru"
4
- tokenizer = FSMTTokenizer.from_pretrained(mname)
5
- model = FSMTForConditionalGeneration.from_pretrained(mname)
 
6
 
7
 
8
  def translator_en_ru(text):
 
1
 
2
  from transformers import FSMTForConditionalGeneration, FSMTTokenizer
3
  mname = "facebook/wmt19-en-ru"
4
+ tokenizer = FSMTTokenizer.from_pretrained(mname, cache_dir='./cache')
5
+ model = FSMTForConditionalGeneration.from_pretrained(
6
+ mname, cache_dir='./cache')
7
 
8
 
9
  def translator_en_ru(text):
utils/translators/en_ru/ru_en.py CHANGED
@@ -1,8 +1,9 @@
1
 
2
  from transformers import FSMTForConditionalGeneration, FSMTTokenizer
3
  mname = "facebook/wmt19-ru-en"
4
- tokenizer = FSMTTokenizer.from_pretrained(mname)
5
- model = FSMTForConditionalGeneration.from_pretrained(mname)
 
6
 
7
 
8
  def translate_ru_en(text):
 
1
 
2
  from transformers import FSMTForConditionalGeneration, FSMTTokenizer
3
  mname = "facebook/wmt19-ru-en"
4
+ tokenizer = FSMTTokenizer.from_pretrained(mname, cache_dir='./cache')
5
+ model = FSMTForConditionalGeneration.from_pretrained(
6
+ mname, cache_dir='./cache')
7
 
8
 
9
  def translate_ru_en(text):