ahm commited on
Commit
bbf3e0a
1 Parent(s): 53d02bf

fix model loading

Browse files
Files changed (2) hide show
  1. README.md +3 -3
  2. added_tokens.json +0 -1
README.md CHANGED
@@ -23,13 +23,13 @@ tags:
23
  ## Utilisation
24
 
25
  ```python
26
- from transformers import MBartForConditionalGeneration, MBartTokenizer
27
  from transformers import SummarizationPipeline
28
 
29
  model_name = 'lincoln/mbart-mlsum-automatic-summarization'
30
 
31
- loaded_tokenizer = MBartTokenizer.from_pretrained(model_name)
32
- loaded_model = MBartForConditionalGeneration.from_pretrained(model_name)
33
 
34
  nlp = SummarizationPipeline(model=loaded_model, tokenizer=loaded_tokenizer)
35
  nlp("""
 
23
  ## Utilisation
24
 
25
  ```python
26
+ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
27
  from transformers import SummarizationPipeline
28
 
29
  model_name = 'lincoln/mbart-mlsum-automatic-summarization'
30
 
31
+ loaded_tokenizer = AutoTokenizer.from_pretrained(model_name)
32
+ loaded_model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
33
 
34
  nlp = SummarizationPipeline(model=loaded_model, tokenizer=loaded_tokenizer)
35
  nlp("""
added_tokens.json DELETED
@@ -1 +0,0 @@
1
- {"af_ZA": 250027, "az_AZ": 250028, "bn_IN": 250029, "fa_IR": 250030, "he_IL": 250031, "hr_HR": 250032, "id_ID": 250033, "ka_GE": 250034, "km_KH": 250035, "mk_MK": 250036, "ml_IN": 250037, "mn_MN": 250038, "mr_IN": 250039, "pl_PL": 250040, "ps_AF": 250041, "pt_XX": 250042, "sv_SE": 250043, "sw_KE": 250044, "ta_IN": 250045, "te_IN": 250046, "th_TH": 250047, "tl_XX": 250048, "uk_UA": 250049, "ur_PK": 250050, "xh_ZA": 250051, "gl_ES": 250052, "sl_SI": 250053}