TSjB commited on
Commit
5bf35d7
·
1 Parent(s): 2d2e045

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import gradio as gr
2
  import torch
3
- from transformers import MBartForConditionalGeneration, MBart50Tokenizer
4
  # model_ru_qm_path = 'TSjB/mbart-large-52-ru-qm-v1'
5
  # model_qm_ru_path = 'TSjB/mbart-large-52-qm-ru-v1'
6
  MODEL_PATH = 'TSjB/NLLB-201-600M-QM-V1'
@@ -10,8 +10,8 @@ MODEL_PATH = 'TSjB/NLLB-201-600M-QM-V1'
10
  #tokenizer_qm_ru = MBart50Tokenizer.from_pretrained(model_qm_ru_path)
11
  #model_ru_qm = MBartForConditionalGeneration.from_pretrained(model_ru_qm_path)
12
  #model_qm_ru = MBartForConditionalGeneration.from_pretrained(model_qm_ru_path)
13
- tokenizer = MBart50Tokenizer.from_pretrained(MODEL_PATH)
14
- model = MBartForConditionalGeneration.from_pretrained(MODEL_PATH)
15
 
16
  # 3. Fix tokenizer
17
  def fixTokenizer(tokenizer, new_lang='krc_Cyrl'):
 
1
  import gradio as gr
2
  import torch
3
+ from transformers import AutoModelForSeq2SeqLM, NllbTokenizer
4
  # model_ru_qm_path = 'TSjB/mbart-large-52-ru-qm-v1'
5
  # model_qm_ru_path = 'TSjB/mbart-large-52-qm-ru-v1'
6
  MODEL_PATH = 'TSjB/NLLB-201-600M-QM-V1'
 
10
  #tokenizer_qm_ru = MBart50Tokenizer.from_pretrained(model_qm_ru_path)
11
  #model_ru_qm = MBartForConditionalGeneration.from_pretrained(model_ru_qm_path)
12
  #model_qm_ru = MBartForConditionalGeneration.from_pretrained(model_qm_ru_path)
13
+ tokenizer = NllbTokenizer.from_pretrained(MODEL_PATH)
14
+ model = AutoModelForSeq2SeqLM.from_pretrained(MODEL_PATH)
15
 
16
  # 3. Fix tokenizer
17
  def fixTokenizer(tokenizer, new_lang='krc_Cyrl'):