You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i use this commande python3 predict_abst.py , here's a what my code looks like :
importglobimportosimportsyssys.path.insert(0, os.path.abspath("./src"))
fromabstractiveimportAbstractiveSummarizerdefsummarize_text(text, model_choice):
summarizer=AbstractiveSummarizer.load_from_checkpoint(model_choice)
# summarizer = AbstractiveSummarizer.load_from_checkpoint(model_choice)returnsummarizer.predict(text)
input="""Johannes Gutenberg (1398 – 1468) was a German goldsmith and publisher who introduced printing to Europe. His introduction of mechanical movable type printing to Europe started the Printing Revolution and is widely regarded as the most important event of the modern period. It played a key role in the scientific revolution and laid the basis for the modern knowledge-based economy and the spread of learning to the masses.Gutenberg many contributions to printing are: the invention of a process for mass-producing movable type, the use of oil-based ink for printing books, adjustable molds, and the use of a wooden printing press. His truly epochal invention was the combination of these elements into a practical system that allowed the mass production of printed books and was economically viable for printers and readers alike.In Renaissance Europe, the arrival of mechanical movable type printing introduced the era of mass communication which permanently altered the structure of society. The relatively unrestricted circulation of information—including revolutionary ideas—transcended borders, and captured the masses in the Reformation. The sharp increase in literacy broke the monopoly of the literate elite on education and learning and bolstered the emerging middle class.t """print(summarize_text(input,"./models/epoch=18-step=2678.ckpt"))```
==============================================================andiamgettingthiserror :
```pythonTraceback (mostrecentcalllast):
File"predict_abst.py", line19, in<module>print(summarize_text(input,"./models/epoch=18-step=2678.ckpt"))
File"predict_abst.py", line9, insummarize_textsummarizer=AbstractiveSummarizer.load_from_checkpoint(model_choice)
File"/opt/conda/envs/transformersum/lib/python3.6/site-packages/pytorch_lightning/core/saving.py", line153, inload_from_checkpointmodel=cls._load_model_state(checkpoint, strict=strict, **kwargs)
File"/opt/conda/envs/transformersum/lib/python3.6/site-packages/pytorch_lightning/core/saving.py", line195, in_load_model_statemodel=cls(**_cls_kwargs)
File"/root/project/transformersum/src/abstractive.py", line113, in__init__gradient_checkpointing=self.hparams.gradient_checkpointing,
File"/opt/conda/envs/transformersum/lib/python3.6/site-packages/transformers/modeling_auto.py", line1213, infrom_pretrainedreturnmodel_class.from_pretrained(pretrained_model_name_or_path, *model_args, config=config, **kwargs)
File"/opt/conda/envs/transformersum/lib/python3.6/site-packages/transformers/modeling_utils.py", line672, infrom_pretrainedmodel=cls(config, *model_args, **model_kwargs)
TypeError: __init__() gotanunexpectedkeywordargument'gradient_checkpointing'```
The text was updated successfully, but these errors were encountered:
Interesting. Please try updating to the latest version of transformers. In v3.0.2, gradient_checkpointing was not an option. As you can see it does not appear in the configuration_bart.py file. However, in the latest version, gradient_checkpointing is present.
i am unable to load a checkpoint into my abstractive model , i don't know why . i am using trasnformersum env with conda :
i use this commande python3 predict_abst.py , here's a what my code looks like :
The text was updated successfully, but these errors were encountered: