ashourzadeh7
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
3 |
import torch
|
4 |
|
5 |
# this model was loaded from https://hf.co/models
|
6 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
7 |
-
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-
|
8 |
-
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-
|
9 |
|
10 |
|
11 |
LANGS = ["pes_Arab", "ckb_Arab", "eng_Latn"]
|
|
|
1 |
+
import gradio as gr
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
3 |
import torch
|
4 |
|
5 |
# this model was loaded from https://hf.co/models
|
6 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
7 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M").to(device)
|
8 |
+
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
|
9 |
|
10 |
|
11 |
LANGS = ["pes_Arab", "ckb_Arab", "eng_Latn"]
|