Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
-
from transformers import
|
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 =
|
14 |
-
model =
|
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'):
|