lm_finetuning | Language Model Fine-tuning for Moby Dick | Natural Language Processing library
kandi X-RAY | lm_finetuning Summary
kandi X-RAY | lm_finetuning Summary
Language Model Fine-tuning for Moby Dick
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Refine text
- Tokenize a sentence
- Generate text
- Download text from url
lm_finetuning Key Features
lm_finetuning Examples and Code Snippets
Community Discussions
Trending Discussions on lm_finetuning
QUESTION
I fine-tuned the BERT base model on my own dataset following the script here:
https://github.com/cedrickchee/pytorch-pretrained-BERT/tree/master/examples/lm_finetuning
I saved the model as a .pt
file and I want to use it now for a sentence similarity task. Unfortunately, it is not clear to me, how to load the fine-tuned model. I tried the following:
ANSWER
Answered 2021-Mar-19 at 12:53To load a model with BertModel.from_pretrained()
you need to have saved it using save_pretrained()
(link).
Any other storage method would require the corresponding load. I am not familiar with S3, but I assume you can use get_object
(link) to retrieve the model, and then save it using the huggingface api. From then on, you should be able to use from_pretrained()
normally.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install lm_finetuning
You can use lm_finetuning like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page