Spaces:
Build error
Build error
Nuo Chen
commited on
Commit
•
b672eb7
1
Parent(s):
d3710b9
Update app.py
Browse files
gradio_samples/bertviz/app.py
CHANGED
@@ -15,7 +15,7 @@ from tqdm.notebook import tqdm
|
|
15 |
from torch.utils.data import DataLoader
|
16 |
from functools import partial
|
17 |
|
18 |
-
from transformers import AutoTokenizer,
|
19 |
|
20 |
from bertviz import model_view, head_view
|
21 |
from bertviz_gradio import head_view_mod
|
@@ -32,7 +32,7 @@ tokenizer_es = AutoTokenizer.from_pretrained(model_es)
|
|
32 |
# tokenizer_zh = AutoTokenizer.from_pretrained(model_zh)
|
33 |
# tokenizer_sw = AutoTokenizer.from_pretrained(model_sw)
|
34 |
|
35 |
-
model_tr_es =
|
36 |
# model_tr_fr = MarianMTModel.from_pretrained(model_fr)
|
37 |
# model_tr_zh = MarianMTModel.from_pretrained(model_zh)
|
38 |
# model_tr_sw = MarianMTModel.from_pretrained(model_sw)
|
@@ -196,4 +196,4 @@ with gr.Blocks(js="plotsjs_bertviz.js") as demo:
|
|
196 |
# demo.load(None,None,None,js="plotsjs.js")
|
197 |
|
198 |
if __name__ == "__main__":
|
199 |
-
demo.launch()
|
|
|
15 |
from torch.utils.data import DataLoader
|
16 |
from functools import partial
|
17 |
|
18 |
+
from transformers import AutoTokenizer, AutoModel, AutoModelForSeq2SeqLM
|
19 |
|
20 |
from bertviz import model_view, head_view
|
21 |
from bertviz_gradio import head_view_mod
|
|
|
32 |
# tokenizer_zh = AutoTokenizer.from_pretrained(model_zh)
|
33 |
# tokenizer_sw = AutoTokenizer.from_pretrained(model_sw)
|
34 |
|
35 |
+
model_tr_es = AutoModel.from_pretrained(model_es)
|
36 |
# model_tr_fr = MarianMTModel.from_pretrained(model_fr)
|
37 |
# model_tr_zh = MarianMTModel.from_pretrained(model_zh)
|
38 |
# model_tr_sw = MarianMTModel.from_pretrained(model_sw)
|
|
|
196 |
# demo.load(None,None,None,js="plotsjs.js")
|
197 |
|
198 |
if __name__ == "__main__":
|
199 |
+
demo.launch()
|