Closed SyedAgha closed 2 years ago
custom_config = AutoConfig.from_pretrained('./bert-large-uncased-config.json')
custom_config.output_hidden_states=True
custom_tokenizer = AutoTokenizer.from_pretrained('./bert-base-uncased-vocab.txt')
custom_model = AutoModel.from_pretrained('./bert-large-uncased-pytorch_model.bin', config=custom_config)
model = Summarizer(custom_model=custom_model, custom_tokenizer=custom_tokenizer, sentence_handler=handler)
print(model(body, num_sentences=3))
Hi,
I am getting following error after running model = Summarizer() in the code:
OSError Traceback (most recent call last) /home/cdsw/.local/lib/python3.6/site-packages/transformers/configuration_utils.py in get_config_dict(cls, pretrained_model_name_or_path, **kwargs) 242 if resolved_config_file is None: --> 243 raise EnvironmentError 244 config_dict = cls._dict_from_json_file(resolved_config_file)
OSError:
During handling of the above exception, another exception occurred:
OSError Traceback (most recent call last)